aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2018-12-28 16:58:59 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2018-12-28 16:58:59 +0000
commit54f151b2d9abb8dfafe4b69ccc783bdec46b65f5 (patch)
tree69bb52ffbd12913ec4356bab1507f76c5e7f4f05
parenteee24ddac89576eaf9efdd3753eb35e1e7bf4a6d (diff)
downloadlynx-snapshots-54f151b2d9abb8dfafe4b69ccc783bdec46b65f5.tar.gz
snapshot of project "lynx", label v2-9-0dev_0e
-rw-r--r--CHANGES9
-rw-r--r--WWW/Library/Implementation/HTGopher.c35
-rw-r--r--src/LYMain.c10
-rw-r--r--src/parsdate.c14
-rw-r--r--src/parsdate.y10
5 files changed, 54 insertions, 24 deletions
diff --git a/CHANGES b/CHANGES
index 2de1caa9..554d944e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,14 @@
--- $LynxId: CHANGES,v 1.996 2018/12/27 23:59:59 tom Exp $
+-- $LynxId: CHANGES,v 1.998 2018/12/28 16:53:36 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
-2018-12-27 (2.9.0dev.1)
+2018-12-28 (2.9.0dev.1)
+* modify generated HTML when processing -source option for a Gopher menu to
+ convert literal "<", "&", and ">" to HTML named entities (report/testcase by
+ Zachary Lee Andrews) -TD
+* build-fix when persistent cookies are disabled (report by Juan Manuel
+ Guerrero) -TD
* memory-leak and dead-code fixes from static analysis (patch by Kamil Dudka).
* restore whitespace in info-page omitted in 2.8.9dev.17, useful for screen
readers (report by Dan Dunfee) -Chuck Martin
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index 854694e5..865985c2 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTGopher.c,v 1.69 2018/12/27 23:48:37 Kamil.Dudka Exp $
+ * $LynxId: HTGopher.c,v 1.71 2018/12/28 16:58:59 tom Exp $
*
* GOPHER ACCESS HTGopher.c
* =============
@@ -28,6 +28,7 @@
#include <HTParse.h>
#include <HTTCP.h>
#include <HTFinger.h>
+#include <LYGlobalDefs.h>
/*
* Implements.
@@ -262,9 +263,33 @@ static void parse_menu(const char *arg GCC_UNUSED,
}
if ((char) ich != LF) {
- *p = (char) ich; /* Put character in line */
- if (p < &line[BIG - 1])
- p++;
+ const char *ss = NULL;
+
+ /*
+ * Help the -source output to look like the HTML equivalent of the
+ * Gopher menu.
+ */
+ if (dump_output_immediately
+ && HTOutputFormat == HTAtom_for("www/dump")) {
+ if (ich == '<') {
+ ss = "&lt;";
+ } else if (ich == '>') {
+ ss = "&gt;";
+ } else if (ich == '&') {
+ ss = "&amp;";
+ }
+ }
+ if (ss != NULL) {
+ if ((p + 5) < &line[BIG - 1]) {
+ while (*ss != '\0') {
+ *p++ = *ss++;
+ }
+ }
+ } else {
+ *p = (char) ich; /* Put character in line */
+ if (p < &line[BIG - 1])
+ p++;
+ }
} else {
*p++ = '\0'; /* Terminate line */
@@ -1172,7 +1197,7 @@ static int generate_cso_form(char *host,
if (ctx.seek) {
/*
- * Command wants us to skip (forward) to indicated token.
+ * Command wants us to skip (forward) to indicated token.
* Start at current position.
*/
size_t slen = strlen(ctx.seek);
diff --git a/src/LYMain.c b/src/LYMain.c
index 36c22ed5..7c8eca0e 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: LYMain.c,v 1.282 2018/07/08 15:22:44 tom Exp $
+ * $LynxId: LYMain.c,v 1.283 2018/12/28 14:21:31 tom Exp $
*/
#include <HTUtils.h>
#include <HTTP.h>
@@ -2361,9 +2361,9 @@ void reload_read_cfg(void)
FREE(tempfile);
return; /* can not write the very own file :( */
}
+#ifdef USE_PERSISTENT_COOKIES
if (LYCookieFile != 0 && LYCookieSaveFile != 0) {
/* set few safe flags: */
-#ifdef USE_PERSISTENT_COOKIES
BOOLEAN persistent_cookies_flag = persistent_cookies;
char *LYCookieFile_flag = NULL;
char *LYCookieSaveFile_flag = NULL;
@@ -2372,8 +2372,6 @@ void reload_read_cfg(void)
StrAllocCopy(LYCookieFile_flag, LYCookieFile);
StrAllocCopy(LYCookieSaveFile_flag, LYCookieSaveFile);
}
-#endif
-
#ifdef USE_CHARSET_CHOICE
custom_assumed_doc_charset = FALSE;
custom_display_charset = FALSE;
@@ -2414,7 +2412,6 @@ void reload_read_cfg(void)
* a major problem: file paths
* like lynx_save_space, LYCookieFile etc.
*/
-#ifdef USE_PERSISTENT_COOKIES
/* restore old settings */
if (persistent_cookies != persistent_cookies_flag) {
persistent_cookies = persistent_cookies_flag;
@@ -2434,9 +2431,8 @@ void reload_read_cfg(void)
FREE(LYCookieFile_flag);
FREE(LYCookieSaveFile_flag);
}
-#endif
-
}
+#endif /* USE_PERSISTENT_COOKIES */
}
#endif /* !NO_CONFIG_INFO */
diff --git a/src/parsdate.c b/src/parsdate.c
index d4a71afd..d0e772f1 100644
--- a/src/parsdate.c
+++ b/src/parsdate.c
@@ -22,7 +22,7 @@
#include <LYLeaks.h>
/*
- * $LynxId: parsdate.c,v 1.26 2018/12/27 22:31:48 tom Exp $
+ * $LynxId: parsdate.c,v 1.27 2018/12/28 01:54:18 tom Exp $
*
* This module is adapted and extended from tin, to use for LYmktime().
*
@@ -672,10 +672,12 @@ static time_t Convert(time_t Month, time_t Day, time_t Year, time_t Hours,
} else if (dst == DSTmaybe) {
struct tm *tm = localtime(&tod);
- if (tm != NULL && tm->tm_isdst)
- Julian -= DST_OFFSET * 60 * 60;
- else
+ if (tm != NULL) {
+ if (tm->tm_isdst)
+ Julian -= DST_OFFSET * 60 * 60;
+ } else {
Julian = BAD_TIME;
+ }
}
return Julian;
}
@@ -1039,7 +1041,7 @@ time_t parsedate(char *p,
* from the error return value. (Alternately could set errno on error.) */
return (Start == BAD_TIME) ? 0 : Start;
}
-#line 1043 "y.tab.c"
+#line 1045 "y.tab.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -1524,7 +1526,7 @@ case 35:
yyval.Meridian = yystack.l_mark[0].Meridian;
}
break;
-#line 1528 "y.tab.c"
+#line 1530 "y.tab.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/src/parsdate.y b/src/parsdate.y
index 182e6a0d..374a87c1 100644
--- a/src/parsdate.y
+++ b/src/parsdate.y
@@ -3,7 +3,7 @@
#include <LYLeaks.h>
/*
- * $LynxId: parsdate.y,v 1.28 2018/12/27 21:56:01 tom Exp $
+ * $LynxId: parsdate.y,v 1.29 2018/12/28 01:53:17 tom Exp $
*
* This module is adapted and extended from tin, to use for LYmktime().
*
@@ -612,10 +612,12 @@ static time_t Convert(time_t Month, time_t Day, time_t Year, time_t Hours,
} else if (dst == DSTmaybe) {
struct tm *tm = localtime(&tod);
- if (tm != NULL && tm->tm_isdst)
- Julian -= DST_OFFSET * 60 * 60;
- else
+ if (tm != NULL) {
+ if (tm->tm_isdst)
+ Julian -= DST_OFFSET * 60 * 60;
+ } else {
Julian = BAD_TIME;
+ }
}
return Julian;
}