diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2009-11-24 10:48:33 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2009-11-24 10:48:33 -0500 |
commit | 99d74890011b0327f07e7d827e5f93a929115ad4 (patch) | |
tree | d50eea426ee833ac4706907b710beea2fc423eef /WWW/Library/Implementation | |
parent | 0890416a30a4441e6936c039207c13cc623678db (diff) | |
download | lynx-snapshots-99d74890011b0327f07e7d827e5f93a929115ad4.tar.gz |
snapshot of project "lynx", label v2-8-8dev_1c
Diffstat (limited to 'WWW/Library/Implementation')
-rw-r--r-- | WWW/Library/Implementation/HTAABrow.c | 12 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTDOS.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTDOS.h | 10 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFTP.c | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTRules.c | 15 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTString.c | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTP.c | 17 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTelnet.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTUtils.h | 7 | ||||
-rw-r--r-- | WWW/Library/Implementation/SGML.h | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/dtd_util.c | 10 | ||||
-rw-r--r-- | WWW/Library/Implementation/src0_HTMLDTD.h | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/src1_HTMLDTD.h | 4 |
13 files changed, 59 insertions, 44 deletions
diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c index 1b859e24..10e80a0d 100644 --- a/WWW/Library/Implementation/HTAABrow.c +++ b/WWW/Library/Implementation/HTAABrow.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTAABrow.c,v 1.29 2009/01/03 00:55:16 tom Exp $ + * $LynxId: HTAABrow.c,v 1.30 2009/11/21 17:05:33 Bela.Lubkin Exp $ * * MODULE HTAABrow.c * BROWSER SIDE ACCESS AUTHORIZATION MODULE @@ -1078,12 +1078,12 @@ BOOL HTAA_shouldRetryWithAuth(char *start_of_headers, 0 == strcasecomp(fieldname, "Proxy-Authenticate:")) || (!IsProxy && 0 == strcasecomp(fieldname, "WWW-Authenticate:"))) { - if (!(arg1 && *arg1 && args && *args)) { + if (isEmpty(arg1) || isEmpty(args)) { HTSprintf0(&temp, gettext("Invalid header '%s%s%s%s%s'"), line, - (!isEmpty(arg1) ? " " : ""), - (!isEmpty(arg1) ? arg1 : ""), - (!isEmpty(args) ? " " : ""), - (!isEmpty(args) ? args : "")); + (non_empty(arg1) ? " " : ""), + NonNull(arg1), + (non_empty(args) ? " " : ""), + NonNull(args)); HTAlert(temp); FREE(temp); } else if (HTAA_UNKNOWN != (scheme = HTAAScheme_enum(arg1))) { diff --git a/WWW/Library/Implementation/HTDOS.c b/WWW/Library/Implementation/HTDOS.c index 69772043..a8090235 100644 --- a/WWW/Library/Implementation/HTDOS.c +++ b/WWW/Library/Implementation/HTDOS.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTDOS.c,v 1.36 2009/01/03 01:58:39 tom Exp $ + * $LynxId: HTDOS.c,v 1.37 2009/09/09 00:40:55 tom Exp $ * DOS specific routines */ @@ -103,7 +103,7 @@ char *HTDOS_slashes(char *path) * ON EXIT: * returns DOS file specification */ -char *HTDOS_name(char *wwwname) +char *HTDOS_name(const char *wwwname) { static char *result = NULL; int joe; @@ -150,7 +150,7 @@ char *HTDOS_name(char *wwwname) } #ifdef WIN_EX -char *HTDOS_short_name(char *path) +char *HTDOS_short_name(const char *path) { static char sbuf[LY_MAXPATH]; char *ret; diff --git a/WWW/Library/Implementation/HTDOS.h b/WWW/Library/Implementation/HTDOS.h index 188b9794..e1613cb0 100644 --- a/WWW/Library/Implementation/HTDOS.h +++ b/WWW/Library/Implementation/HTDOS.h @@ -1,4 +1,8 @@ -/* DOS specific routines */ +/* + * $LynxId: HTDOS.h,v 1.14 2009/09/09 00:16:06 tom Exp $ + * + * DOS specific routines + */ #ifndef HTDOS_H #define HTDOS_H @@ -33,10 +37,10 @@ char *HTDOS_slashes(char *path); * * Bug: Returns pointer to static -- non-reentrant */ -char *HTDOS_name(char *wwwname); +char *HTDOS_name(const char *wwwname); #ifdef WIN_EX -char *HTDOS_short_name(char *fn); +char *HTDOS_short_name(const char *fn); #else #define HTDOS_short_name(fn) fn diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 6f71fae9..93857a0d 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFTP.c,v 1.89 2009/02/01 12:49:00 tom Exp $ + * $LynxId: HTFTP.c,v 1.90 2009/09/07 23:36:28 tom Exp $ * * File Transfer Protocol (FTP) Client * for a WorldWideWeb browser @@ -1631,8 +1631,10 @@ static void parse_eplf_line(char *line, static void parse_ls_line(char *line, EntryInfo *entry) { +#ifdef LONG_LIST char *next; char *cp; +#endif int i, j; unsigned long base = 1; unsigned long size_num = 0; diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c index 3f129f16..b235414d 100644 --- a/WWW/Library/Implementation/HTRules.c +++ b/WWW/Library/Implementation/HTRules.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTRules.c,v 1.38 2009/02/01 21:19:02 tom Exp $ + * $LynxId: HTRules.c,v 1.39 2009/11/21 15:01:20 Kihara.Hideto Exp $ * * Configuration manager for Hypertext Daemon HTRules.c * ========================================== @@ -462,10 +462,17 @@ int HTSetConfiguration(char *config) StrAllocCopy(line, config); { - char *p = strchr(line, '#'); /* Chop off comments */ + char *p = line; - if (p) - *p = 0; + /* Chop off comments */ + while ((p = strchr(p, '#'))) { + if (p == line || isspace(UCH(*(p - 1)))) { + *p = 0; + break; + } else { + p++; + } + } } pointer = line; word1 = HTNextField(&pointer); diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c index 9c5d5172..c6bdb348 100644 --- a/WWW/Library/Implementation/HTString.c +++ b/WWW/Library/Implementation/HTString.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTString.c,v 1.57 2009/03/17 22:27:59 tom Exp $ + * $LynxId: HTString.c,v 1.58 2009/11/21 17:05:33 Bela.Lubkin Exp $ * * Case-independent string comparison HTString.c * @@ -1307,7 +1307,7 @@ bstring *HTBprintf(bstring **pstr, const char *fmt,...) LYva_start(ap, fmt); { temp = StrAllocVsprintf(&temp, 0, fmt, &ap); - if (!isEmpty(temp)) { + if (non_empty(temp)) { HTSABCat(pstr, temp, strlen(temp)); } FREE(temp); diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 2a70cb49..b7ac85fa 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTP.c,v 1.110 2009/08/27 00:56:00 tom Exp $ + * $LynxId: HTTP.c,v 1.112 2009/11/21 17:05:33 Bela.Lubkin Exp $ * * HyperText Tranfer Protocol - Client implementation HTTP.c * ========================== @@ -1159,7 +1159,7 @@ static int HTLoadHTTP(const char *arg, } if (LYSendUserAgent || no_useragent) { - if (!isEmpty(LYUserAgent)) { + if (non_empty(LYUserAgent)) { char *cp = LYSkipBlanks(LYUserAgent); /* Won't send it at all if all blank - kw */ @@ -1977,12 +1977,13 @@ static int HTLoadHTTP(const char *arg, switch (server_status) { case 401: /* Unauthorized */ /* - * Authorization for orgin server required. If show_401 is - * set, proceed to showing the 401 body. Otherwise, if we - * can set up authorization based on the WWW-Authenticate - * header, and the user provides a username and password, - * try again. Otherwise, check whether to show the 401 - * body or restore the current document. - FM + * Authorization for origin server required. If show_401 + * is set, proceed to showing the 401 body. Otherwise, if + * we can set up authorization based on the + * WWW-Authenticate header, and the user provides a + * username and password, try again. Otherwise, check + * whether to show the 401 body or restore the current + * document - FM */ if (show_401) break; diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c index 7765920e..f525d5c7 100644 --- a/WWW/Library/Implementation/HTTelnet.c +++ b/WWW/Library/Implementation/HTTelnet.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTelnet.c,v 1.38 2007/07/01 23:13:22 Daniel.Dickman Exp $ + * $LynxId: HTTelnet.c,v 1.39 2009/11/21 17:05:33 Bela.Lubkin Exp $ * * Telnet Access, Rlogin, etc HTTelnet.c * ========================== @@ -44,11 +44,11 @@ static void do_system(char *) GCC_UNUSED; static void do_system(char *command) { - if (!isEmpty(command)) { + if (non_empty(command)) { CTRACE((tfp, "HTTelnet: Command is: %s\n\n", command)); LYSystem(command); - FREE(command); } + FREE(command); } /* Telnet or "rlogin" access diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index ecd20607..60cf00c3 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -1,5 +1,5 @@ /* - * $LynxId: HTUtils.h,v 1.94 2009/05/10 23:06:31 tom Exp $ + * $LynxId: HTUtils.h,v 1.96 2009/11/21 17:05:33 Bela.Lubkin Exp $ * * Utility macros for the W3 code library * MACROS FOR GENERAL USE @@ -310,6 +310,7 @@ Standard C library for malloc() etc #endif #define isEmpty(s) ((s) == 0 || *(s) == 0) +#define non_empty(s) !isEmpty(s) #define NonNull(s) (((s) != 0) ? s : "") #define NONNULL(s) (((s) != 0) ? s : "(null)") @@ -466,7 +467,7 @@ Out Of Memory checking for malloc() return: #ifndef TOLOWER -#ifdef EXP_ASCII_CTYPES +#ifdef USE_ASCII_CTYPES #define TOLOWER(c) ascii_tolower(UCH(c)) #define TOUPPER(c) ascii_toupper(UCH(c)) @@ -738,7 +739,7 @@ extern int WWW_TraceMask; extern "C" { #endif #ifndef TOLOWER -#ifdef EXP_ASCII_CTYPES +#ifdef USE_ASCII_CTYPES extern int ascii_toupper(int); extern int ascii_tolower(int); extern int ascii_isupper(int); diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h index 08c1538a..7868317d 100644 --- a/WWW/Library/Implementation/SGML.h +++ b/WWW/Library/Implementation/SGML.h @@ -1,5 +1,5 @@ /* - * $LynxId: SGML.h,v 1.43 2009/04/16 00:50:16 tom Exp $ + * $LynxId: SGML.h,v 1.44 2009/11/21 15:24:48 tom Exp $ * SGML parse and stream definition for libwww * SGML AND STRUCTURED STREAMS * @@ -148,7 +148,7 @@ extern "C" { #ifdef USE_COLOR_STYLE unsigned name_len; /* The length of the name */ #endif -#ifdef EXP_JUSTIFY_ELTS +#ifdef USE_JUSTIFY_ELTS BOOL can_justify; /* justification allowed? */ #endif AttrList attributes; /* The list of acceptable attributes */ diff --git a/WWW/Library/Implementation/dtd_util.c b/WWW/Library/Implementation/dtd_util.c index cfa5a789..407b8b65 100644 --- a/WWW/Library/Implementation/dtd_util.c +++ b/WWW/Library/Implementation/dtd_util.c @@ -1,5 +1,5 @@ /* - * $LynxId: dtd_util.c,v 1.72 2009/04/16 22:59:33 tom Exp $ + * $LynxId: dtd_util.c,v 1.73 2009/11/21 15:24:48 tom Exp $ * * Given a SGML_dtd structure, write a corresponding flat file, or "C" source. * Given the flat-file, write the "C" source. @@ -580,7 +580,7 @@ static void dump_src_HTTag(FILE *output, const SGML_dtd * dtd, int which) HTTag *tag = &(dtd->tags[which]); char *P_macro = "P"; -#ifdef EXP_JUSTIFY_ELTS +#ifdef USE_JUSTIFY_ELTS if (!tag->can_justify) P_macro = "P0"; #endif @@ -724,7 +724,7 @@ static void dump_source(FILE *output, const SGML_dtd * dtd, int dtd_version) NOTE("#define NULL_HTTag_ NULL"); NOTE("#endif"); NOTE(""); - NOTE("#ifdef EXP_JUSTIFY_ELTS"); + NOTE("#ifdef USE_JUSTIFY_ELTS"); NOTE("#define P(x) P_(x), 1"); NOTE("#define P0(x) P_(x), 0"); NOTE("#define NULL_HTTag NULL_HTTag_,0"); @@ -952,7 +952,7 @@ static void dump_flat_TagFlags(FILE *output, const char *name, TagFlags theFlags static void dump_flat_HTTag(FILE *output, unsigned n, HTTag * tag) { fprintf(output, "\t%u:%s\n", n, tag->name); -#ifdef EXP_JUSTIFY_ELTS +#ifdef USE_JUSTIFY_ELTS fprintf(output, "\t\t%s\n", tag->can_justify ? "justify" : "nojustify"); #endif dump_flat_attrs(output, tag->attributes, AttrCount(tag)); @@ -1199,7 +1199,7 @@ static int load_flat_HTTag(FILE *input, unsigned nref, HTTag * tag, AttrType * a #ifdef USE_COLOR_STYLE tag->name_len = strlen(tag->name); #endif -#ifdef EXP_JUSTIFY_ELTS +#ifdef USE_JUSTIFY_ELTS if (fscanf(input, "%s\n", name) == 1) { tag->can_justify = !strcmp(name, "justify"); } else { diff --git a/WWW/Library/Implementation/src0_HTMLDTD.h b/WWW/Library/Implementation/src0_HTMLDTD.h index 845ed598..53d6620d 100644 --- a/WWW/Library/Implementation/src0_HTMLDTD.h +++ b/WWW/Library/Implementation/src0_HTMLDTD.h @@ -1,4 +1,4 @@ -/* $LynxId: src0_HTMLDTD.h,v 1.42 2009/04/16 22:55:54 tom Exp $ */ +/* $LynxId: src0_HTMLDTD.h,v 1.43 2009/11/21 15:24:48 tom Exp $ */ #ifndef src_HTMLDTD_H0 #define src_HTMLDTD_H0 1 @@ -2275,7 +2275,7 @@ static const attr UL_attr[] = { /* DIR attributes */ #define NULL_HTTag_ NULL #endif -#ifdef EXP_JUSTIFY_ELTS +#ifdef USE_JUSTIFY_ELTS #define P(x) P_(x), 1 #define P0(x) P_(x), 0 #define NULL_HTTag NULL_HTTag_,0 diff --git a/WWW/Library/Implementation/src1_HTMLDTD.h b/WWW/Library/Implementation/src1_HTMLDTD.h index c2bc87fb..d4ee6e43 100644 --- a/WWW/Library/Implementation/src1_HTMLDTD.h +++ b/WWW/Library/Implementation/src1_HTMLDTD.h @@ -1,4 +1,4 @@ -/* $LynxId: src1_HTMLDTD.h,v 1.42 2009/04/16 22:55:54 tom Exp $ */ +/* $LynxId: src1_HTMLDTD.h,v 1.43 2009/11/21 15:24:48 tom Exp $ */ #ifndef src_HTMLDTD_H1 #define src_HTMLDTD_H1 1 @@ -2275,7 +2275,7 @@ static const attr UL_attr[] = { /* DIR attributes */ #define NULL_HTTag_ NULL #endif -#ifdef EXP_JUSTIFY_ELTS +#ifdef USE_JUSTIFY_ELTS #define P(x) P_(x), 1 #define P0(x) P_(x), 0 #define NULL_HTTag NULL_HTTag_,0 |