w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit f50f4880b1c62095bd121cdd29a48303f9710179
parent db2cf2815fe5cce6fcc5114b5b11e94f22c18732
Author: ukai <ukai>
Date:   Thu, 24 Jan 2002 16:59:16 +0000

[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:
MChangeLog | 10++++++++++
Mfile.c | 5+++--
Mfm.h | 9++++-----
Mrc.c | 13++++++++++---
4 files changed, 27 insertions(+), 10 deletions(-)

diff --git 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 diff --git a/file.c b/file.c @@ -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 @@ -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 @@ -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 */