diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2013-05-02 11:09:30 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2013-05-02 11:09:30 -0400 |
commit | 844a17014bd45706a13ee5318b36a56fbcf6924c (patch) | |
tree | 1f6fbe9df293ae7e477671384c5a69a195e15b26 /WWW | |
parent | 81905f18dc0594e372cf38cfb0e0b71b69849a43 (diff) | |
download | lynx-snapshots-844a17014bd45706a13ee5318b36a56fbcf6924c.tar.gz |
snapshot of project "lynx", label v2-8-8dev-15c
Diffstat (limited to 'WWW')
-rw-r--r-- | WWW/Library/Implementation/HTAnchor.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFTP.c | 42 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFile.c | 34 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFormat.c | 10 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTGopher.c | 8 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTPlain.c | 34 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTWSRC.c | 11 |
7 files changed, 58 insertions, 87 deletions
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index a3ebaeb7..0c784e3e 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTAnchor.c,v 1.71 2012/02/03 01:52:50 tom Exp $ + * $LynxId: HTAnchor.c,v 1.73 2013/05/02 10:46:12 tom Exp $ * * Hypertext "Anchor" Object HTAnchor.c * ========================== @@ -774,7 +774,7 @@ static void HTParentAnchor_free(HTParentAnchor *me) if ((fd = fopen(me->FileCache, "r")) != NULL) { fclose(fd); - remove(me->FileCache); + (void) remove(me->FileCache); } FREE(me->FileCache); } @@ -823,7 +823,7 @@ void HTAnchor_clearSourceCache(HTParentAnchor *me) if (me->source_cache_file) { CTRACE((tfp, "SourceCache: Removing file %s\n", me->source_cache_file)); - LYRemoveTemp(me->source_cache_file); + (void) LYRemoveTemp(me->source_cache_file); FREE(me->source_cache_file); } if (me->source_cache_chunk) { diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index b2edabd1..43e3083e 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFTP.c,v 1.114 2013/01/05 01:35:12 tom Exp $ + * $LynxId: HTFTP.c,v 1.116 2013/05/01 10:46:59 tom Exp $ * * File Transfer Protocol (FTP) Client * for a WorldWideWeb browser @@ -4140,23 +4140,23 @@ int HTFTPLoad(const char *name, format = HTCharsetFormat(format, anchor, -1); StrAllocCopy(anchor->content_type, format->name); format = HTAtom_for("www/compressed"); + } - switch (cft) { - case cftCompress: - StrAllocCopy(anchor->content_encoding, "x-compress"); - break; - case cftGzip: - StrAllocCopy(anchor->content_encoding, "x-gzip"); - break; - case cftDeflate: - StrAllocCopy(anchor->content_encoding, "x-deflate"); - break; - case cftBzip2: - StrAllocCopy(anchor->content_encoding, "x-bzip2"); - break; - case cftNone: - break; - } + switch (cft) { + case cftCompress: + StrAllocCopy(anchor->content_encoding, "x-compress"); + break; + case cftGzip: + StrAllocCopy(anchor->content_encoding, "x-gzip"); + break; + case cftDeflate: + StrAllocCopy(anchor->content_encoding, "x-deflate"); + break; + case cftBzip2: + StrAllocCopy(anchor->content_encoding, "x-bzip2"); + break; + case cftNone: + break; } } FREE(FileName); @@ -4177,8 +4177,9 @@ int HTFTPLoad(const char *name, outstanding = 0; CTRACE((tfp, "HTFTP: Closing data socket %d\n", data_soc)); status = NETCLOSE(data_soc); - } else + } else { status = 2; /* data_soc already closed in HTCopy - kw */ + } if (status < 0 && rv != HT_INTERRUPTED && rv != -1) { (void) HTInetStatus("close"); /* Comment only */ @@ -4189,10 +4190,9 @@ int HTFTPLoad(const char *name, data_soc = -1; /* invalidate it */ init_help_message_cache(); /* to free memory */ return HTLoadError(sink, 500, response_text); - } else if (status <= 0) { - outstanding = 0; - } else if (status == 2 && !StrNCmp(response_text, "221", 3)) + } else if (status == 2 && !StrNCmp(response_text, "221", 3)) { outstanding = 0; + } } } final_status = HT_LOADED; diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index a0640512..9a1c7120 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFile.c,v 1.135 2013/05/01 00:09:25 tom Exp $ + * $LynxId: HTFile.c,v 1.136 2013/05/01 10:48:11 tom Exp $ * * File Access HTFile.c * =========== @@ -2881,22 +2881,22 @@ int HTLoadFile(const char *addr, FREE(cp); value = HTStackValue(format, format_out, filevalue, 0L); - switch (cft) { - case cftCompress: - atomname = "application/x-compressed"; - break; - case cftGzip: - atomname = "application/x-gzip"; - break; - case cftDeflate: - atomname = "application/x-deflate"; - break; - case cftBzip2: - atomname = "application/x-bzip2"; - break; - case cftNone: - break; - } + } + switch (cft) { + case cftCompress: + atomname = "application/x-compressed"; + break; + case cftGzip: + atomname = "application/x-gzip"; + break; + case cftDeflate: + atomname = "application/x-deflate"; + break; + case cftBzip2: + atomname = "application/x-bzip2"; + break; + case cftNone: + break; } if (atomname != NULL) { diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index fa211af7..7731b372 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFormat.c,v 1.76 2012/11/17 01:31:19 tom Exp $ + * $LynxId: HTFormat.c,v 1.78 2013/05/01 10:52:13 tom Exp $ * * Manage different file formats HTFormat.c * ============================= @@ -1094,11 +1094,7 @@ static int HTGzFileCopy(gzFile gzfp, HTStream *sink) if (HTCheckForInterrupt()) { _HTProgress(TRANSFER_INTERRUPTED); - if (bytes) { - rv = HT_INTERRUPTED; - } else { - rv = -1; - } + rv = HT_INTERRUPTED; break; } } /* next bufferload */ @@ -1200,7 +1196,7 @@ static int HTZzFileCopy(FILE *zzfp, HTStream *sink) status = inflateReset(&s); if (status != Z_OK) { CTRACE((tfp, "HTZzFileCopy inflateReset() %s\n", zError(status))); - rv = bytes ? HT_PARTIAL_CONTENT : -1; + rv = -1; break; } s.next_in = (Bytef *) dummy_head; diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index 57492b1d..cf51b023 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTGopher.c,v 1.58 2013/01/04 21:10:29 tom Exp $ + * $LynxId: HTGopher.c,v 1.60 2013/05/01 22:20:13 tom Exp $ * * GOPHER ACCESS HTGopher.c * ============= @@ -1138,9 +1138,7 @@ static int generate_cso_form(char *host, */ out = 0; buf[out] = '\0'; - for (i = full_flag ? /***1***/ 0 : 0; - ctemplate[i]; - i++) { + for (i = 0; ctemplate[i]; i++) { /* * Search the current string for substitution, flagged by $( */ @@ -1423,7 +1421,7 @@ static int generate_cso_report(HTStream *Target) (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } } else { - HTSprintf0(&buf, "<DD>%s\n", fname ? fname : rcode); + HTSprintf0(&buf, "<DD>%s\n", fname); (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } } diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c index b3e80c6f..c46b30df 100644 --- a/WWW/Library/Implementation/HTPlain.c +++ b/WWW/Library/Implementation/HTPlain.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTPlain.c,v 1.49 2011/06/11 12:09:07 tom Exp $ + * $LynxId: HTPlain.c,v 1.51 2013/05/02 11:09:30 tom Exp $ * * Plain text object HTWrite.c * ================= @@ -151,41 +151,17 @@ static void HTPlain_put_character(HTStream *me, int c) } else if (TOASCII(UCH(c)) >= 127 && TOASCII(UCH(c)) < 161 && HTPassHighCtrlRaw) { HText_appendCharacter(me->text, c); +#if CH_NBSP < 127 } else if (UCH(c) == CH_NBSP) { /* S/390 -- gil -- 0341 */ HText_appendCharacter(me->text, ' '); +#endif +#if CH_SHY < 127 } else if (UCH(c) == CH_SHY) { return; +#endif } else if ((UCH(c) >= ' ' && TOASCII(UCH(c)) < 127) || c == '\n' || c == '\t') { HText_appendCharacter(me->text, c); - } else if (TOASCII(UCH(c)) > 160) { - if (!HTPassEightBitRaw && - !((me->outUCLYhndl == LATIN1) || - (me->outUCI->enc & (UCT_CP_SUPERSETOF_LAT1)))) { - int len, high, low, i, diff = 1; - const char *name; - UCode_t value = (UCode_t) FROMASCII((TOASCII(UCH(c)) - 160)); - - name = HTMLGetEntityName(value); - len = (int) strlen(name); - for (low = 0, high = (int) HTML_dtd.number_of_entities; - high > low; - diff < 0 ? (low = i + 1) : (high = i)) { - /* Binary search */ - i = (low + (high - low) / 2); - diff = AS_ncmp(HTML_dtd.entity_names[i], name, (unsigned) len); - if (diff == 0) { - HText_appendText(me->text, - LYCharSets[me->outUCLYhndl][i]); - break; - } - } - if (diff) { - HText_appendCharacter(me->text, c); - } - } else { - HText_appendCharacter(me->text, c); - } } #endif /* REMOVE_CR_ONLY */ } diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c index cd161009..1136da0f 100644 --- a/WWW/Library/Implementation/HTWSRC.c +++ b/WWW/Library/Implementation/HTWSRC.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTWSRC.c,v 1.28 2011/06/11 12:11:53 tom Exp $ + * $LynxId: HTWSRC.c,v 1.29 2013/05/01 22:32:59 tom Exp $ * * Parse WAIS Source file HTWSRC.c * ====================== @@ -187,11 +187,12 @@ static void WSRCParser_put_character(HTStream *me, int c) me->param_count = 0; if (c == '"') { me->state = quoted_value; - break; + } else { + me->state = ((c == '(') + ? bracketed_value + : value); + me->param[me->param_count++] = (char) c; /* Don't miss first character */ } - me->state = (c == '"') ? quoted_value : - (c == '(') ? bracketed_value : value; - me->param[me->param_count++] = (char) c; /* Don't miss first character */ break; case value: |