aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-24 16:59:16 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-24 16:59:16 +0000
commitfbb3e57fab17414fa2fef95754b31c3d130cd61f (patch)
tree346060a70cb6b2fc8015aacef10b32542ea42669
parent[w3m-dev 02896] fid attr value should be in sequence (diff)
downloadw3m-fbb3e57fab17414fa2fef95754b31c3d130cd61f.tar.gz
w3m-fbb3e57fab17414fa2fef95754b31c3d130cd61f.zip
[w3m-dev 02901] ACCEPT_BAD_COOKIE_*
* file.c (readHeader): accept_bad_cookie is one of ACCEPT_BAD_COOKIE_* * fm.h (PERHAPS): deleted * fm.h (ACCEPT_BAD_COOKIE_*): added * rc.c (n_s): added * rc.c (N_S): added * rc.c (badcookiestr): use N_S(ACCEPT_BAD_COOKIE_*) From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--ChangeLog12
-rw-r--r--file.c7
-rw-r--r--fm.h11
-rw-r--r--rc.c15
4 files changed, 31 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index d20e46a..f067c22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-01-25 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+
+ * [w3m-dev 02901] ACCEPT_BAD_COOKIE_*
+ * file.c (readHeader): accept_bad_cookie is one of ACCEPT_BAD_COOKIE_*
+ * fm.h (PERHAPS): deleted
+ * fm.h (ACCEPT_BAD_COOKIE_*): added
+ * rc.c (n_s): added
+ * rc.c (N_S): added
+ * rc.c (badcookiestr): use N_S(ACCEPT_BAD_COOKIE_*)
+
2002-01-24 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02896] fid attr value should be in sequence
@@ -2242,4 +2252,4 @@
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.255 2002/01/23 17:57:10 ukai Exp $
+$Id: ChangeLog,v 1.256 2002/01/24 16:59:16 ukai Exp $
diff --git a/file.c b/file.c
index b5ccba4..bcc45a9 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.46 2002/01/23 17:19:47 ukai Exp $ */
+/* $Id: file.c,v 1.47 2002/01/24 16:59:16 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -727,9 +727,10 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
add_cookie(pu, name, value, expires, domain, path, flag,
comment, version, port, commentURL);
if (err) {
- char *ans = (accept_bad_cookie == TRUE) ? "y" : NULL;
+ char *ans = (accept_bad_cookie == ACCEPT_BAD_COOKIE_ACCEPT)
+ ? "y" : NULL;
if (fmInitialized && (err & COO_OVERRIDE_OK) &&
- accept_bad_cookie == PERHAPS) {
+ accept_bad_cookie == ACCEPT_BAD_COOKIE_ASK) {
Str msg =
Sprintf
("Accept bad cookie from %s for %s? (y or n) ",
diff --git a/fm.h b/fm.h
index 652c7ba..102ae70 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.41 2002/01/21 15:56:13 ukai Exp $ */
+/* $Id: fm.h,v 1.42 2002/01/24 16:59:16 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -88,10 +88,6 @@ void bzero(void *, int);
#define FALSE 0
#define TRUE 1
-#ifdef USE_COOKIE
-#define PERHAPS 2
-#endif
-
#define SHELLBUFFERNAME "*Shellout*"
#define PIPEBUFFERNAME "*stream*"
#define CPIPEBUFFERNAME "*stream(closed)*"
@@ -843,7 +839,10 @@ global int reverse_mouse init(FALSE);
global int default_use_cookie init(TRUE);
global int use_cookie init(FALSE);
global int accept_cookie init(FALSE);
-global int accept_bad_cookie init(FALSE);
+#define ACCEPT_BAD_COOKIE_DISCARD 0
+#define ACCEPT_BAD_COOKIE_ACCEPT 1
+#define ACCEPT_BAD_COOKIE_ASK 2
+global int accept_bad_cookie init(ACCEPT_BAD_COOKIE_DISCARD);
global char *cookie_reject_domains init(NULL);
global char *cookie_accept_domains init(NULL);
global TextList *Cookie_reject_domains;
diff --git a/rc.c b/rc.c
index d5db499..9693df8 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.32 2002/01/21 15:56:13 ukai Exp $ */
+/* $Id: rc.c,v 1.33 2002/01/24 16:59:16 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -362,6 +362,13 @@ static struct sel_c colorstr[] = {
};
#endif /* USE_COLOR */
+static char n_s[][2] = {
+ {'0', 0},
+ {'1', 0},
+ {'2', 0},
+};
+#define N_S(x) (x), n_s[(x)]
+
#ifdef INET6
static struct sel_c dnsorders[] = {
{0, "0", "unspec"},
@@ -373,11 +380,11 @@ static struct sel_c dnsorders[] = {
#ifdef USE_COOKIE
static struct sel_c badcookiestr[] = {
- {0, "0", "discard"},
+ {N_S(ACCEPT_BAD_COOKIE_DISCARD), "discard"},
#if 0
- {1, "1", "accept"},
+ {N_S(ACCEPT_BAD_COOKIE_ACCEPT), "accept"},
#endif
- {2, "2", "ask"},
+ {N_S(ACCEPT_BAD_COOKIE_ASK), "ask"},
{0, NULL, NULL}
};
#endif /* USE_COOKIE */