about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2008-12-30 01:18:43 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2008-12-30 01:18:43 -0500
commit54bbe9318f6e9aca131a985cb7ab1e979c1130ef (patch)
treec3db407b34718d9b9356b593992c875bf46f6ed2 /src
parented2d970693bd42f56001960e78f70fc97c925491 (diff)
downloadlynx-snapshots-54bbe9318f6e9aca131a985cb7ab1e979c1130ef.tar.gz
snapshot of project "lynx", label v2-8-7dev_11c
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c114
-rw-r--r--src/GridText.h8
-rw-r--r--src/HTML.c6
-rw-r--r--src/LYCharSets.c7
-rw-r--r--src/LYCharUtils.c4
-rw-r--r--src/LYEdit.c4
-rw-r--r--src/LYExtern.c15
-rw-r--r--src/LYExtern.h9
-rw-r--r--src/LYGlobalDefs.h6
-rw-r--r--src/LYMain.c53
-rw-r--r--src/LYMainLoop.c25
-rw-r--r--src/LYMap.c20
-rw-r--r--src/LYOptions.c14
-rw-r--r--src/LYReadCFG.c7
-rw-r--r--src/LYStrings.c6
-rw-r--r--src/LYUtils.h3
-rw-r--r--src/LYebcdic.c48
-rw-r--r--src/LYexit.c10
-rw-r--r--src/LYmktime.c37
-rw-r--r--src/LYrcFile.h3
-rw-r--r--src/UCdomap.c4
-rw-r--r--src/Xsystem.c15
-rw-r--r--src/makefile.in40
-rw-r--r--src/parsdate.c18
-rw-r--r--src/parsdate.y18
25 files changed, 214 insertions, 280 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 3cf376b7..c5dddab8 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: GridText.c,v 1.158 2008/12/07 18:50:31 tom Exp $
+ * $LynxId: GridText.c,v 1.162 2008/12/30 00:53:29 tom Exp $
  *
  *		Character grid hypertext object
  *		===============================
@@ -439,7 +439,6 @@ struct _HText {
     int hiddenlinkflag;		/*  ... and how to treat them */
     BOOL no_cache;		/* Always refresh? */
     char LastChar;		/* For absorbing white space */
-    BOOL IgnoreExcess;		/* Ignore chars at wrap point */
 
 /* For Internal use: */
     HTStyle *style;		/* Current style */
@@ -1116,7 +1115,6 @@ HText *HText_new(HTParentAnchor *anchor)
 		      ? YES
 		      : NO);
     self->LastChar = '\0';
-    self->IgnoreExcess = FALSE;
 
 #ifndef USE_PRETTYSRC
     if (HTOutputFormat == WWW_SOURCE)
@@ -2539,9 +2537,8 @@ void HText_beginAppend(HText *text)
  *		If display_on_the_fly is set, then it is decremented and
  *		the finished line is displayed.
  */
-#define new_line(text) split_line(text, 0)
 
-#define DEBUG_SPLITLINE
+/* #define DEBUG_SPLITLINE */
 
 #ifdef DEBUG_SPLITLINE
 #define CTRACE_SPLITLINE(p)	CTRACE(p)
@@ -3483,6 +3480,18 @@ static void split_line(HText *text, unsigned split)
     return;
 }				/* split_line */
 
+#ifdef DEBUG_SPLITLINE
+static void do_new_line(HText *text, const char *fn, int ln)
+{
+    CTRACE_SPLITLINE((tfp, "new_line %s@%d\n", fn, ln));
+    split_line(text, 0);
+}
+
+#define new_line(text) do_new_line(text, __FILE__, __LINE__)
+#else
+#define new_line(text) split_line(text, 0)
+#endif
+
 /*	Allow vertical blank space
  *	--------------------------
  */
@@ -3560,7 +3569,6 @@ void HText_appendCharacter(HText *text, int ch)
     HTLine *line;
     HTStyle *style;
     int indent;
-    int limit = 0;
     int actual;
 
 #ifdef DEBUG_APPCH
@@ -4266,36 +4274,6 @@ void HText_appendCharacter(HText *text, int ch)
     }
 
     /*
-     * Check if we should ignore characters at the wrap point.
-     */
-    if (text->IgnoreExcess) {
-	int nominal = (indent + (int) (line->offset + line->size) - ctrl_chars_on_this_line);
-	int number;
-
-	limit = WRAP_COLS(text);
-	if (fields_are_numbered()
-	    && !number_fields_on_left
-	    && text->last_anchor != 0
-	    && (number = text->last_anchor->number) > 0) {
-	    limit -= (number > 99999
-		      ? 6
-		      : (number > 9999
-			 ? 5
-			 : (number > 999
-			    ? 4
-			    : (number > 99
-			       ? 3
-			       : (number > 9
-				  ? 2
-				  : 1))))) + 2;
-	}
-	if ((nominal + (int) style->rightIndent) >= limit
-	    || (nominal + UTFXTRA_ON_THIS_LINE) >= LYcols_cu(text)) {
-	    return;
-	}
-    }
-
-    /*
      * Check for end of line.
      */
     actual = ((indent + (int) line->offset + (int) line->size) +
@@ -4312,7 +4290,7 @@ void HText_appendCharacter(HText *text, int ch)
 		 + UTFXTRA_ON_THIS_LINE
 		 - ctrl_chars_on_this_line
 		 + UTF_XLEN(ch)
-		) >= (LYcols_cu(text) - 1)))) {
+		) > (LYcols_cu(text) - 1)))) {
 
 	if (style->wordWrap && HTOutputFormat != WWW_SOURCE) {
 #ifdef EXP_JUSTIFY_ELTS
@@ -4569,17 +4547,6 @@ char HText_getLastChar(HText *text)
     return ((char) text->LastChar);
 }
 
-/*	Set IgnoreExcess element in the text object.
- *	--------------------------------------------
- */
-void HText_setIgnoreExcess(HText *text, BOOL ignore)
-{
-    if (!text)
-	return;
-
-    text->IgnoreExcess = ignore;
-}
-
 /*		Simple table handling - private
  *		-------------------------------
  */
@@ -8486,10 +8453,7 @@ BOOLEAN HTreparse_document(void)
 
     if (!HTMainAnchor || LYCacheSource == SOURCE_CACHE_NONE) {
 	CTRACE((tfp, "HTreparse_document returns FALSE\n"));
-	return FALSE;
-    }
-
-    if (useSourceCache()) {
+    } else if (useSourceCache()) {
 	FILE *fp;
 	HTFormat format;
 	int ret;
@@ -8526,32 +8490,31 @@ BOOLEAN HTreparse_document(void)
 	    CTRACE((tfp, "  Cannot read file %s\n", HTMainAnchor->source_cache_file));
 	    LYRemoveTemp(HTMainAnchor->source_cache_file);
 	    FREE(HTMainAnchor->source_cache_file);
-	    return FALSE;
-	}
+	} else {
 
-	if (HText_HaveUserChangedForms(HTMainText)) {
-	    /*
-	     * Issue a warning.  Will not restore changed forms, currently.
+	    if (HText_HaveUserChangedForms(HTMainText)) {
+		/*
+		 * Issue a warning.  Will not restore changed forms, currently.
+		 */
+		HTAlert(RELOADING_FORM);
+	    }
+	    /* Set HTMainAnchor->protocol or HTMainAnchor->physical to convince
+	     * the SourceCacheWriter to not regenerate the cache file (which
+	     * would be an unnecessary "loop"). - kw
 	     */
-	    HTAlert(RELOADING_FORM);
-	}
-	/* Set HTMainAnchor->protocol or HTMainAnchor->physical to convince
-	 * the SourceCacheWriter to not regenerate the cache file (which
-	 * would be an unnecessary "loop"). - kw
-	 */
-	HTAnchor_setProtocol(HTMainAnchor, &HTFile);
-	ret = HTParseFile(format, HTOutputFormat, HTMainAnchor, fp, NULL);
-	LYCloseInput(fp);
-	if (ret == HT_PARTIAL_CONTENT) {
-	    HTInfoMsg(gettext("Loading incomplete."));
-	    CTRACE((tfp,
-		    "SourceCache: `%s' has been accessed, partial content.\n",
-		    HTLoadedDocumentURL()));
-	}
-	ok = (BOOL) (ret == HT_LOADED || ret == HT_PARTIAL_CONTENT);
-
-	CTRACE((tfp, "Reparse file %s\n", (ok ? "succeeded" : "failed")));
+	    HTAnchor_setProtocol(HTMainAnchor, &HTFile);
+	    ret = HTParseFile(format, HTOutputFormat, HTMainAnchor, fp, NULL);
+	    LYCloseInput(fp);
+	    if (ret == HT_PARTIAL_CONTENT) {
+		HTInfoMsg(gettext("Loading incomplete."));
+		CTRACE((tfp,
+			"SourceCache: `%s' has been accessed, partial content.\n",
+			HTLoadedDocumentURL()));
+	    }
+	    ok = (BOOL) (ret == HT_LOADED || ret == HT_PARTIAL_CONTENT);
 
+	    CTRACE((tfp, "Reparse file %s\n", (ok ? "succeeded" : "failed")));
+	}
     } else if (useMemoryCache()) {
 	HTFormat format = WWW_HTML;
 	int ret;
@@ -10157,7 +10120,6 @@ void HText_endInput(HText *text)
 	&& text->last_anchor->number > 0) {
 	char marker[20];
 
-	HText_setIgnoreExcess(text, FALSE);
 	sprintf(marker, "[%d]", text->last_anchor->number);
 	HText_appendText(text, marker);
     }
diff --git a/src/GridText.h b/src/GridText.h
index 43fcd28f..1d39ea70 100644
--- a/src/GridText.h
+++ b/src/GridText.h
@@ -1,5 +1,8 @@
-/*	Specialities of GridText as subclass of HText
-*/
+/*
+ * $LynxId: GridText.h,v 1.60 2008/12/29 21:36:00 tom Exp $
+ *
+ * Specialities of GridText as subclass of HText
+ */
 #ifndef LYGRIDTEXT_H
 #define LYGRIDTEXT_H
 
@@ -89,7 +92,6 @@ US-ASCII control characters <32 which are not defined in Unicode standard
 
     extern void HText_setLastChar(HText *text, char ch);
     extern char HText_getLastChar(HText *text);
-    extern void HText_setIgnoreExcess(HText *text, BOOL ignore);
 
     extern int HText_sourceAnchors(HText *text);
     extern void HText_setStale(HText *text);
diff --git a/src/HTML.c b/src/HTML.c
index 7dacdee9..9ac89ab6 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTML.c,v 1.116 2008/12/14 20:03:28 tom Exp $
+ * $LynxId: HTML.c,v 1.117 2008/12/29 21:22:28 tom Exp $
  *
  *		Structured stream to Rich hypertext converter
  *		============================================
@@ -4881,7 +4881,6 @@ static int HTML_start_element(HTStructured * me, int element_number,
 		    HTML_put_character(me, '_');
 		    chars--;
 		}
-		HText_setIgnoreExcess(me->text, TRUE);
 	    }
 	    CTRACE((tfp, "I.%s, %d\n", NONNULL(I.type), IsSubmitOrReset));
 	    if (IsSubmitOrReset == FALSE) {
@@ -4946,7 +4945,6 @@ static int HTML_start_element(HTStructured * me, int element_number,
 	    if (chars != 0) {
 		HText_endInput(me->text);
 	    }
-	    HText_setIgnoreExcess(me->text, FALSE);
 	    FREE(ImageSrc);
 	    FREE(I_value);
 	    FREE(I_name);
@@ -7047,7 +7045,6 @@ static int HTML_end_element(HTStructured * me, int element_number,
 			    HText_appendCharacter(me->text, *ptr);
 			ptr++;
 		    }
-		    HText_setIgnoreExcess(me->text, TRUE);
 		}
 		for (; non_empty(ptr); ptr++) {
 		    if (*ptr == ' ')
@@ -7078,7 +7075,6 @@ static int HTML_end_element(HTStructured * me, int element_number,
 		    HText_setLastChar(me->text, ']');
 		    me->in_word = YES;
 		}
-		HText_setIgnoreExcess(me->text, FALSE);
 	    }
 	    HTChunkClear(&me->option);
 
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index db56146a..ae03cdcc 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYCharSets.c,v 1.58 2008/09/06 15:45:56 tom Exp $
+ * $LynxId: LYCharSets.c,v 1.59 2008/12/26 16:15:27 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTCJK.h>
@@ -419,9 +419,8 @@ void HTMLSetCharacterHandling(int i)
 	else
 	    LYRawMode = (BOOL) (!LYUseDefaultRawMode);
 
-	HTPassEightBitNum = (BOOL) (
-				       ((LYCharSet_UC[i].codepoints & UCT_CP_SUPERSETOF_LAT1)
-					|| (LYCharSet_UC[i].like8859 & UCT_R_HIGH8BIT)));
+	HTPassEightBitNum = (BOOL) ((LYCharSet_UC[i].codepoints & UCT_CP_SUPERSETOF_LAT1)
+				    || (LYCharSet_UC[i].like8859 & UCT_R_HIGH8BIT));
 
 	if (LYRawMode) {
 	    HTPassEightBitRaw = (BOOL) (LYlowest_eightbit[i] <= 160);
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index d4b5917a..78cfe0d2 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYCharUtils.c,v 1.92 2008/09/06 14:40:45 tom Exp $
+ * $LynxId: LYCharUtils.c,v 1.93 2008/12/29 21:22:28 tom Exp $
  *
  *  Functions associated with LYCharSets.c and the Lynx version of HTML.c - FM
  *  ==========================================================================
@@ -2963,7 +2963,6 @@ void LYHandleSELECT(HTStructured * me, const BOOL *present,
 			HText_appendCharacter(me->text, *ptr);
 		    ptr++;
 		}
-		HText_setIgnoreExcess(me->text, TRUE);
 	    }
 	    for (; non_empty(ptr); ptr++) {
 		if (*ptr == ' ')
@@ -2979,7 +2978,6 @@ void LYHandleSELECT(HTStructured * me, const BOOL *present,
 		HText_setLastChar(me->text, ']');
 		me->in_word = YES;
 	    }
-	    HText_setIgnoreExcess(me->text, FALSE);
 	}
 	HTChunkClear(&me->option);
 
diff --git a/src/LYEdit.c b/src/LYEdit.c
index 545f0c33..07c8eda6 100644
--- a/src/LYEdit.c
+++ b/src/LYEdit.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYEdit.c,v 1.37 2008/03/18 00:39:05 Paul.B.Mahol Exp $ */
+/* $LynxId: LYEdit.c,v 1.38 2008/12/29 01:00:53 tom Exp $ */
 #include <HTUtils.h>
 #include <HTParse.h>
 #include <HTAlert.h>
@@ -253,7 +253,7 @@ void edit_temporary_file(char *filename,
 	 * we don't, but at least put out a message.  - kw
 	 */
 	{
-#ifdef UNIX
+#if defined(UNIX) && defined(WIFEXITED)
 	    int save_err = errno;
 
 	    CTRACE((tfp, "ExtEditForm: system() returned %d (0x%x), %s\n",
diff --git a/src/LYExtern.c b/src/LYExtern.c
index 714220dd..d3453a0d 100644
--- a/src/LYExtern.c
+++ b/src/LYExtern.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYExtern.c,v 1.40 2008/07/04 15:06:14 tom Exp $
+ * $LynxId: LYExtern.c,v 1.41 2008/12/29 01:34:31 tom Exp $
  *
  External application support.
  This feature allows lynx to pass a given URL to an external program.
@@ -67,19 +67,6 @@ static char *decode_string(char *s)
 
 #ifdef WIN_EX
 /*
- * Quote the path to make it safe for shell command processing.
- *  We always quote it not only includes spaces in it.
- *  At least we should quote paths which include "&".
- */
-char *quote_pathname(char *pathname)
-{
-    char *result = NULL;
-
-    HTSprintf0(&result, "\"%s\"", pathname);
-    return result;
-}
-
-/*
  *  Delete dangerous characters as local path.
  *  We delete '<>|' and also '%"'.
  *  '%' should be deleted because it's difficut to escape for all cases.
diff --git a/src/LYExtern.h b/src/LYExtern.h
index 4d77b1db..e88bbd6d 100644
--- a/src/LYExtern.h
+++ b/src/LYExtern.h
@@ -1,3 +1,4 @@
+/* $LynxId: LYExtern.h,v 1.13 2008/12/29 18:59:39 tom Exp $ */
 #ifndef EXTERNALS_H
 #define EXTERNALS_H
 
@@ -8,13 +9,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-/* returns TRUE if something matching was executed */ BOOL run_external(char
-									*c, BOOL only_overriders);
-
-#ifdef WIN_EX
-    extern char *quote_pathname(char *pathname);
-#endif
-
+    extern BOOL run_external(char *c, BOOL only_overriders);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index 6fc8d56b..a989b365 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYGlobalDefs.h,v 1.113 2008/12/14 18:07:20 tom Exp $
+ * $LynxId: LYGlobalDefs.h,v 1.115 2008/12/26 18:25:27 tom Exp $
  *
  * global variable definitions
  */
@@ -65,6 +65,7 @@ extern "C" {
 #ifndef VMS
     extern char *list_format;
 #endif				/* !VMS */
+    extern char *ftp_format;
 
 #ifdef DIRED_SUPPORT
 
@@ -630,10 +631,7 @@ extern "C" {
     extern int lynx_timeout;
 #endif				/* _WINDOWS */
 
-#ifdef SH_EX
     extern BOOLEAN show_cfg;
-#endif
-
     extern BOOLEAN no_table_center;
 
 #if USE_BLAT_MAILER
diff --git a/src/LYMain.c b/src/LYMain.c
index f28db16e..e0d617c3 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.190 2008/12/26 01:18:43 tom Exp $
+ * $LynxId: LYMain.c,v 1.194 2008/12/30 01:01:34 Paul.Gilmartin Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -95,6 +95,8 @@ static char *lynx_version_putenv_command = NULL;
 char *list_format = NULL;	/* LONG_LIST formatting mask */
 #endif /* !VMS */
 
+char *ftp_format = NULL;	/* LONG_LIST formatting mask */
+
 #ifdef SYSLOG_REQUESTED_URLS
 char *syslog_txt = NULL;	/* syslog arb text for session */
 BOOLEAN syslog_requested_urls = TRUE;
@@ -338,9 +340,7 @@ CRITICAL_SECTION critSec_READ;	/* 1998/09/03 (Thu) 22:01:56 */
 BOOLEAN system_is_NT = FALSE;
 #endif
 
-#ifdef SH_EX
 BOOLEAN show_cfg = FALSE;
-#endif
 
 BOOLEAN no_table_center = FALSE;	/* 1998/10/09 (Fri) 15:12:49 */
 
@@ -703,6 +703,7 @@ static void free_lynx_globals(void)
 {
     int i;
 
+    FREE(ftp_format);
 #ifndef VMS
     FREE(list_format);
 #ifdef LYNXCGI_LINKS		/* WebSter Mods -jkt */
@@ -843,36 +844,12 @@ void exit_immediately(int code)
 }
 
 #ifdef  EBCDIC
-/* *INDENT-OFF* */
-      char un_IBM1047[ 256 ] = "";
-unsigned char IBM1047[ 256 ] = /* ATOE OEMVS311 */
-{
-0x00,0x01,0x02,0x03,0x37,0x2d,0x2e,0x2f,0x16,0x05,0x15,0x0b,0x0c,0x0d,0x0e,0x0f,
-0x10,0x11,0x12,0x13,0x3c,0x3d,0x32,0x26,0x18,0x19,0x3f,0x27,0x1c,0x1d,0x1e,0x1f,
-0x40,0x5a,0x7f,0x7b,0x5b,0x6c,0x50,0x7d,0x4d,0x5d,0x5c,0x4e,0x6b,0x60,0x4b,0x61,
-0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0x7a,0x5e,0x4c,0x7e,0x6e,0x6f,
-0x7c,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,
-0xd7,0xd8,0xd9,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xad,0xe0,0xbd,0x5f,0x6d,
-0x79,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x91,0x92,0x93,0x94,0x95,0x96,
-0x97,0x98,0x99,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xc0,0x4f,0xd0,0xa1,0x07,
-0x20,0x21,0x22,0x23,0x24,0x25,0x06,0x17,0x28,0x29,0x2a,0x2b,0x2c,0x09,0x0a,0x1b,
-0x30,0x31,0x1a,0x33,0x34,0x35,0x36,0x08,0x38,0x39,0x3a,0x3b,0x04,0x14,0x3e,0xff,
-0x41,0xaa,0x4a,0xb1,0x9f,0xb2,0x6a,0xb5,0xbb,0xb4,0x9a,0x8a,0xb0,0xca,0xaf,0xbc,
-0x90,0x8f,0xea,0xfa,0xbe,0xa0,0xb6,0xb3,0x9d,0xda,0x9b,0x8b,0xb7,0xb8,0xb9,0xab,
-0x64,0x65,0x62,0x66,0x63,0x67,0x9e,0x68,0x74,0x71,0x72,0x73,0x78,0x75,0x76,0x77,
-0xac,0x69,0xed,0xee,0xeb,0xef,0xec,0xbf,0x80,0xfd,0xfe,0xfb,0xfc,0xba,0xae,0x59,
-0x44,0x45,0x42,0x46,0x43,0x47,0x9c,0x48,0x54,0x51,0x52,0x53,0x58,0x55,0x56,0x57,
-0x8c,0x49,0xcd,0xce,0xcb,0xcf,0xcc,0xe1,0x70,0xdd,0xde,0xdb,0xdc,0x8d,0x8e,0xdf
-} ;
-/* *INDENT-ON* */
-
 static void FixCharacters(void)
 {
     int c;
     int work1[256], work2[256];
 
     for (c = 0; c < 256; c++) {
-	un_IBM1047[IBM1047[c]] = c;
 	work1[c] = keymap[c + 1];
 	work2[c] = key_override[c + 1];
     }
@@ -1152,6 +1129,7 @@ int main(int argc,
 #ifndef VMS
     StrAllocCopy(list_format, LIST_FORMAT);
 #endif /* !VMS */
+    StrAllocCopy(ftp_format, FTP_FORMAT);
 
     AlertSecs = SECS2Secs(ALERTSECS);
     DebugSecs = SECS2Secs(DEBUGSECS);
@@ -1797,13 +1775,10 @@ int main(int argc,
     if (!LYCheckUserAgent()) {
 	HTAlwaysAlert(gettext("Warning:"), UA_NO_LYNX_WARNING);
     }
-#ifdef SH_EX
     if (show_cfg) {
 	cleanup();
 	exit_immediately(EXIT_SUCCESS);
     }
-#endif
-
 #ifdef USE_SLANG
     if (LYShowColor >= SHOW_COLOR_ON &&
 	!(Lynx_Color_Flags & SL_LYNX_USE_COLOR)) {
@@ -1945,9 +1920,9 @@ int main(int argc,
     if (!TRACE && !dump_output_immediately && !stack_dump) {
 	(void) signal(SIGINT, cleanup_sig);
 #ifndef __linux__
-#ifndef DOSPATH
+#ifdef SIGBUS
 	(void) signal(SIGBUS, FatalProblem);
-#endif /* DOSPATH */
+#endif /* SIGBUS */
 #endif /* !__linux__ */
 	(void) signal(SIGSEGV, FatalProblem);
 	(void) signal(SIGILL, FatalProblem);
@@ -1959,10 +1934,10 @@ int main(int argc,
 	 * disconnected terminal.  So the runaway CPU time problem on Unix
 	 * should not occur any more.
 	 */
-#ifndef DOSPATH
+#ifdef SIGPIPE
 	if (signal(SIGPIPE, SIG_IGN) != SIG_IGN)
 	    restore_sigpipe_for_children = TRUE;
-#endif /* DOSPATH */
+#endif /* SIGPIPE */
     }
 #endif /* !VMS */
 
@@ -3838,12 +3813,10 @@ saves session to that file on exit"
       "short_url",	4|SET_ARG,		long_url_ok,
       "enables examination of beginning and end of long URL in\nstatus line"
    ),
-#ifdef SH_EX
    PARSE_SET(
       "show_cfg",	1|SET_ARG,		show_cfg,
       "Show `LYNX.CFG' setting"
    ),
-#endif
    PARSE_SET(
       "show_cursor",	4|TOGGLE_ARG,		LYUseDefShoCur,
       "toggles hiding of the cursor in the lower right corner"
@@ -4373,9 +4346,9 @@ static void FatalProblem(int sig)
     (void) signal(SIGTERM, SIG_IGN);
     (void) signal(SIGINT, SIG_IGN);
 #ifndef __linux__
-#ifndef DOSPATH
+#ifdef SIGBUS
     (void) signal(SIGBUS, SIG_IGN);
-#endif /* ! DOSPATH */
+#endif /* ! SIGBUS */
 #endif /* !__linux__ */
     (void) signal(SIGSEGV, SIG_IGN);
     (void) signal(SIGILL, SIG_IGN);
@@ -4394,9 +4367,9 @@ static void FatalProblem(int sig)
     }
     cleanup_sig(0);
 #ifndef __linux__
-#ifndef DOSPATH
+#ifdef SIGBUS
     signal(SIGBUS, SIG_DFL);
-#endif /* DOSPATH */
+#endif /* SIGBUS */
 #endif /* !__linux__ */
     signal(SIGSEGV, SIG_DFL);
     signal(SIGILL, SIG_DFL);
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index cd245caf..c2e21255 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMainLoop.c,v 1.157 2008/12/14 18:42:42 tom Exp $
+ * $LynxId: LYMainLoop.c,v 1.158 2008/12/26 17:41:19 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTAccess.h>
@@ -124,29 +124,6 @@ static void set_ws_title(char *str)
 
 #endif /* WIN_EX */
 
-#ifdef SH_EX			/* 1998/10/30 (Fri) 10:06:47 */
-
-#define NOT_EQU	1
-
-static int str_n_cmp(const char *p, const char *q, int n)
-{
-    if (n == 0)
-	return 0;
-
-    if (p == NULL)
-	return NOT_EQU;
-
-    if (q == NULL)
-	return NOT_EQU;
-
-    return strncmp(p, q, n);
-}
-
-#undef strncmp
-#define	strncmp(p, q, r)	str_n_cmp(p, q, r)
-
-#endif /* SH_EX */
-
 #if defined(USE_EXTERNALS) || defined(WIN_EX)
 #include <LYExtern.h>
 #endif
diff --git a/src/LYMap.c b/src/LYMap.c
index 41a4b752..e9eef794 100644
--- a/src/LYMap.c
+++ b/src/LYMap.c
@@ -1,4 +1,6 @@
-/*			Lynx Client-side Image MAP Support	       LYMap.c
+/*
+ * $LynxId: LYMap.c,v 1.36 2008/12/27 15:15:28 tom Exp $
+ *			Lynx Client-side Image MAP Support	       LYMap.c
  *			==================================
  *
  *	Author: FM	Foteos Macrides (macrides@sci.wfbr.edu)
@@ -326,14 +328,17 @@ BOOL LYHaveImageMap(char *address)
  * anAnchor is the LYNXIMGMAP: anchor; if it is associated with POST
  *	    data, we want the specific list, otherwise the global list.
  */
-static void fill_DocAddress(DocAddress *wwwdoc, char *address,
+static void fill_DocAddress(DocAddress *wwwdoc,
+			    const char *address,
 			    HTParentAnchor *anAnchor,
 			    HTParentAnchor **punderlying)
 {
+    char *doc_address = NULL;
     HTParentAnchor *underlying;
 
+    StrAllocCopy(doc_address, address);
     if (anAnchor && anAnchor->post_data) {
-	wwwdoc->address = address;
+	wwwdoc->address = doc_address;
 	wwwdoc->post_data = anAnchor->post_data;
 	wwwdoc->post_content_type = anAnchor->post_content_type;
 	wwwdoc->bookmark = NULL;
@@ -345,7 +350,7 @@ static void fill_DocAddress(DocAddress *wwwdoc, char *address,
 	if (punderlying)
 	    *punderlying = underlying;
     } else {
-	wwwdoc->address = address;
+	wwwdoc->address = doc_address;
 	wwwdoc->post_data = NULL;
 	wwwdoc->post_content_type = NULL;
 	wwwdoc->bookmark = NULL;
@@ -373,7 +378,8 @@ static void fill_DocAddress(DocAddress *wwwdoc, char *address,
  * LYLoadIMGmap() will never have post_data, so that the global list
  * will be used. - kw
  */
-static HTList *get_the_list(DocAddress *wwwdoc, char *address,
+static HTList *get_the_list(DocAddress *wwwdoc,
+			    const char *address,
 			    HTParentAnchor *anchor,
 			    HTParentAnchor **punderlying)
 {
@@ -408,7 +414,7 @@ static int LYLoadIMGmap(const char *arg,
     char *MapAddress = NULL;
     HTList *theList;
     HTList *cur = NULL;
-    char *address = NULL;
+    const char *address = NULL;
     char *cp = NULL;
     DocAddress WWWDoc;
     HTParentAnchor *underlying;
@@ -417,7 +423,7 @@ static int LYLoadIMGmap(const char *arg,
     HTFormat old_format_out = HTOutputFormat;
 
     if (isLYNXIMGMAP(arg)) {
-	address = (char *) (arg + LEN_LYNXIMGMAP);
+	address = (arg + LEN_LYNXIMGMAP);
     }
     if (!(address && strchr(address, ':'))) {
 	HTAlert(MISDIRECTED_MAP_REQUEST);
diff --git a/src/LYOptions.c b/src/LYOptions.c
index f7b93b1a..3629bd0d 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYOptions.c,v 1.124 2008/07/04 15:06:56 tom Exp $ */
+/* $LynxId: LYOptions.c,v 1.125 2008/12/29 19:37:13 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <HTTP.h>		/* 'reloading' flag */
@@ -530,13 +530,13 @@ void LYoptions(void)
 
     LYmove(L_Keypad, 5);
     addlbl("(K)eypad mode                : ");
-    LYaddstr(fields_are_numbered() && links_are_numbered()
+    LYaddstr((fields_are_numbered() && links_are_numbered())
 	     ? "Links and form fields are numbered"
-	     : links_are_numbered()
-	     ? "Links are numbered                "
-	     : fields_are_numbered()
-	     ? "Form fields are numbered          "
-	     : "Numbers act as arrows             ");
+	     : (links_are_numbered()
+		? "Links are numbered                "
+		: (fields_are_numbered()
+		   ? "Form fields are numbered          "
+		   : "Numbers act as arrows             ")));
 
     LYmove(L_Lineed, 5);
     addlbl("li(N)e edit style            : ");
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index f39f2309..2b998a70 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYReadCFG.c,v 1.131 2008/12/09 01:01:34 tom Exp $
+ * $LynxId: LYReadCFG.c,v 1.133 2008/12/26 18:26:52 tom Exp $
  */
 #ifndef NO_RULES
 #include <HTRules.h>
@@ -1385,6 +1385,7 @@ static Config_Type Config_Table [] =
 #if !defined(NO_OPTION_FORMS) && !defined(NO_OPTION_MENU)
      PARSE_SET(RC_FORMS_OPTIONS,        LYUseFormsOptions),
 #endif
+     PARSE_STR(RC_FTP_FORMAT,           ftp_format),
 #ifndef DISABLE_FTP
      PARSE_SET(RC_FTP_PASSIVE,          ftp_passive),
 #endif
@@ -1900,14 +1901,12 @@ static void do_read_cfg(const char *cfg_filename,
     /*
      * Process each line in the file.
      */
-#ifdef SH_EX
     if (show_cfg) {
 	time_t t;
 
 	time(&t);
 	printf("### %s %s, at %s", LYNX_NAME, LYNX_VERSION, ctime(&t));
     }
-#endif
     while (LYSafeGets(&buffer, fp) != 0) {
 	char *name, *value;
 	char *cp;
@@ -1959,10 +1958,8 @@ static void do_read_cfg(const char *cfg_filename,
 	    CTRACE((tfp, "LYReadCFG: ignored %s:%s\n", name, value));
 	    continue;
 	}
-#ifdef SH_EX
 	if (show_cfg)
 	    printf("%s:%s\n", name, value);
-#endif
 
 	if (allowed && (*allowed)[tbl - Config_Table]) {
 	    if (fp0 == NULL)
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 87d70158..3d45773f 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.158 2008/09/21 23:26:30 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.159 2008/12/26 16:46:43 tom Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <UCAux.h>
@@ -2038,7 +2038,7 @@ static int LYgetch_for(int code)
 	case KEY_RIGHT:	/* ... */
 	    c = RTARROW;
 	    break;
-#if defined(SH_EX) && defined(DOSPATH)	/* for NEC PC-9800 1998/08/30 (Sun) 21:50:35 */
+#if defined(PDCURSES)		/* for NEC PC-9800 1998/08/30 (Sun) 21:50:35 */
 	case KEY_C2:
 	    c = DNARROW;
 	    break;
@@ -2057,7 +2057,7 @@ static int LYgetch_for(int code)
 	case PADSTOP:		/* PC-9800 DEL */
 	    c = REMOVE_KEY;
 	    break;
-#endif /* SH_EX */
+#endif /* PDCURSES */
 	case KEY_HOME:		/* Home key (upward+left arrow) */
 	    c = HOME;
 	    break;
diff --git a/src/LYUtils.h b/src/LYUtils.h
index 67b4460b..2cdf0cc5 100644
--- a/src/LYUtils.h
+++ b/src/LYUtils.h
@@ -1,4 +1,4 @@
-/* $LynxId: LYUtils.h,v 1.77 2008/02/10 21:45:40 tom Exp $ */
+/* $LynxId: LYUtils.h,v 1.78 2008/12/29 01:33:26 tom Exp $ */
 #ifndef LYUTILS_H
 #define LYUTILS_H
 
@@ -218,6 +218,7 @@ extern "C" {
 
 #if defined(_WIN_CC) || defined(WIN_EX)
     extern int exec_command(char *cmd, int wait_flag);	/* xsystem.c */
+    extern char *quote_pathname(char *pathname);
     extern int xsystem(char *cmd);
 #endif
 
diff --git a/src/LYebcdic.c b/src/LYebcdic.c
new file mode 100644
index 00000000..30c98220
--- /dev/null
+++ b/src/LYebcdic.c
@@ -0,0 +1,48 @@
+/*
+ * $LynxId: LYebcdic.c,v 1.1 2008/12/30 01:03:05 Paul.Gilmartin Exp $
+ */
+#include <HTUtils.h>
+
+#ifdef  EBCDIC
+/* *INDENT-OFF* */
+const       char un_IBM1047[ 256 ] = /* ETOA OEMVS311 */
+{
+0x00,0x01,0x02,0x03,0x9c,0x09,0x86,0x7f,0x97,0x8d,0x8e,0x0b,0x0c,0x0d,0x0e,0x0f,
+0x10,0x11,0x12,0x13,0x9d,0x0a,0x08,0x87,0x18,0x19,0x92,0x8f,0x1c,0x1d,0x1e,0x1f,
+0x80,0x81,0x82,0x83,0x84,0x85,0x17,0x1b,0x88,0x89,0x8a,0x8b,0x8c,0x05,0x06,0x07,
+0x90,0x91,0x16,0x93,0x94,0x95,0x96,0x04,0x98,0x99,0x9a,0x9b,0x14,0x15,0x9e,0x1a,
+0x20,0xa0,0xe2,0xe4,0xe0,0xe1,0xe3,0xe5,0xe7,0xf1,0xa2,0x2e,0x3c,0x28,0x2b,0x7c,
+0x26,0xe9,0xea,0xeb,0xe8,0xed,0xee,0xef,0xec,0xdf,0x21,0x24,0x2a,0x29,0x3b,0x5e,
+0x2d,0x2f,0xc2,0xc4,0xc0,0xc1,0xc3,0xc5,0xc7,0xd1,0xa6,0x2c,0x25,0x5f,0x3e,0x3f,
+0xf8,0xc9,0xca,0xcb,0xc8,0xcd,0xce,0xcf,0xcc,0x60,0x3a,0x23,0x40,0x27,0x3d,0x22,
+0xd8,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0xab,0xbb,0xf0,0xfd,0xfe,0xb1,
+0xb0,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0xaa,0xba,0xe6,0xb8,0xc6,0xa4,
+0xb5,0x7e,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0xa1,0xbf,0xd0,0x5b,0xde,0xae,
+0xac,0xa3,0xa5,0xb7,0xa9,0xa7,0xb6,0xbc,0xbd,0xbe,0xdd,0xa8,0xaf,0x5d,0xb4,0xd7,
+0x7b,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0xad,0xf4,0xf6,0xf2,0xf3,0xf5,
+0x7d,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0xb9,0xfb,0xfc,0xf9,0xfa,0xff,
+0x5c,0xf7,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0xb2,0xd4,0xd6,0xd2,0xd3,0xd5,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xb3,0xdb,0xdc,0xd9,0xda,0x9f
+} ;
+const unsigned char IBM1047[ 256 ] = /* ATOE OEMVS311 */
+{
+0x00,0x01,0x02,0x03,0x37,0x2d,0x2e,0x2f,0x16,0x05,0x15,0x0b,0x0c,0x0d,0x0e,0x0f,
+0x10,0x11,0x12,0x13,0x3c,0x3d,0x32,0x26,0x18,0x19,0x3f,0x27,0x1c,0x1d,0x1e,0x1f,
+0x40,0x5a,0x7f,0x7b,0x5b,0x6c,0x50,0x7d,0x4d,0x5d,0x5c,0x4e,0x6b,0x60,0x4b,0x61,
+0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0x7a,0x5e,0x4c,0x7e,0x6e,0x6f,
+0x7c,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,
+0xd7,0xd8,0xd9,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xad,0xe0,0xbd,0x5f,0x6d,
+0x79,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x91,0x92,0x93,0x94,0x95,0x96,
+0x97,0x98,0x99,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xc0,0x4f,0xd0,0xa1,0x07,
+0x20,0x21,0x22,0x23,0x24,0x25,0x06,0x17,0x28,0x29,0x2a,0x2b,0x2c,0x09,0x0a,0x1b,
+0x30,0x31,0x1a,0x33,0x34,0x35,0x36,0x08,0x38,0x39,0x3a,0x3b,0x04,0x14,0x3e,0xff,
+0x41,0xaa,0x4a,0xb1,0x9f,0xb2,0x6a,0xb5,0xbb,0xb4,0x9a,0x8a,0xb0,0xca,0xaf,0xbc,
+0x90,0x8f,0xea,0xfa,0xbe,0xa0,0xb6,0xb3,0x9d,0xda,0x9b,0x8b,0xb7,0xb8,0xb9,0xab,
+0x64,0x65,0x62,0x66,0x63,0x67,0x9e,0x68,0x74,0x71,0x72,0x73,0x78,0x75,0x76,0x77,
+0xac,0x69,0xed,0xee,0xeb,0xef,0xec,0xbf,0x80,0xfd,0xfe,0xfb,0xfc,0xba,0xae,0x59,
+0x44,0x45,0x42,0x46,0x43,0x47,0x9c,0x48,0x54,0x51,0x52,0x53,0x58,0x55,0x56,0x57,
+0x8c,0x49,0xcd,0xce,0xcb,0xcf,0xcc,0xe1,0x70,0xdd,0xde,0xdb,0xdc,0x8d,0x8e,0xdf
+} ;
+/* *INDENT-ON* */
+
+#endif /* EBCDIC */
diff --git a/src/LYexit.c b/src/LYexit.c
index e5d06aec..37d7b519 100644
--- a/src/LYexit.c
+++ b/src/LYexit.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYexit.c,v 1.33 2007/05/06 21:41:43 tom Exp $
+ * $LynxId: LYexit.c,v 1.34 2008/12/29 01:03:20 tom Exp $
  *
  *	Copyright (c) 1994, University of Kansas, All Rights Reserved
  *	(most of this file was rewritten in 1996 and 2004).
@@ -105,9 +105,9 @@ void LYexit(int status)
 	(void) signal(SIGTERM, SIG_IGN);
 	(void) signal(SIGINT, SIG_IGN);
 #ifndef __linux__
-#ifndef DOSPATH
+#ifdef SIGBUS
 	(void) signal(SIGBUS, SIG_IGN);
-#endif /* DOSPATH */
+#endif /* SIGBUS */
 #endif /* !__linux__ */
 	(void) signal(SIGSEGV, SIG_IGN);
 	(void) signal(SIGILL, SIG_IGN);
@@ -126,9 +126,9 @@ void LYexit(int status)
 	}
 	cleanup_sig(0);
 #ifndef __linux__
-#ifndef DOSPATH
+#ifdef SIGBUS
 	signal(SIGBUS, SIG_DFL);
-#endif /* DOSPATH */
+#endif /* SIGBUS */
 #endif /* !__linux__ */
 	signal(SIGSEGV, SIG_DFL);
 	signal(SIGILL, SIG_DFL);
diff --git a/src/LYmktime.c b/src/LYmktime.c
index 8116dad0..32de4275 100644
--- a/src/LYmktime.c
+++ b/src/LYmktime.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYmktime.c,v 1.8 2008/12/25 00:42:09 tom Exp $ */
+/* $LynxId: LYmktime.c,v 1.9 2008/12/27 00:46:30 tom Exp $ */
 
 #include <LYStrings.h>
 #include <LYUtils.h>
@@ -60,33 +60,18 @@ time_t LYmktime(char *string,
     time_t result = 0;
 
     if (non_empty(string)) {
-#ifdef EBCDIC
-	int n;
-	char *copied = NULL;
+	CTRACE((tfp, "LYmktime: Parsing '%s'\n", string));
+	result = parsedate(string, 0);
 
-	StrAllocCopy(copied, string);
-	if (copied != NULL) {
-	    /* parsedate() expects ASCII input */
-	    for (n = 0; copied[n] != '\0'; ++n)
-		copied[n] = TOASCII(copied[n]);
-	    string = copied;
-#endif
-	    CTRACE((tfp, "LYmktime: Parsing '%s'\n", string));
-	    result = parsedate(string, 0);
-
-	    if (!absolute) {
-		if ((time((time_t *) 0) - result) >= 0)
-		    result = 0;
-	    }
-	    if (result != 0) {
-		CTRACE((tfp, "LYmktime: clock=%" PRI_time_t ", ctime=%s",
-			CAST_time_t(result),
-			ctime(&result)));
-	    }
-#ifdef EBCDIC
-	    free(copied);
+	if (!absolute) {
+	    if ((time((time_t *) 0) - result) >= 0)
+		result = 0;
+	}
+	if (result != 0) {
+	    CTRACE((tfp, "LYmktime: clock=%" PRI_time_t ", ctime=%s",
+		    CAST_time_t(result),
+		    ctime(&result)));
 	}
-#endif
     }
     return result;
 #else
diff --git a/src/LYrcFile.h b/src/LYrcFile.h
index ed617786..5ad055c5 100644
--- a/src/LYrcFile.h
+++ b/src/LYrcFile.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYrcFile.h,v 1.28 2008/12/07 20:52:27 tom Exp $
+ * $LynxId: LYrcFile.h,v 1.29 2008/12/26 18:34:05 tom Exp $
  */
 #ifndef LYRCFILE_H
 #define LYRCFILE_H
@@ -84,6 +84,7 @@
 #define RC_FORCE_SSL_COOKIES_SECURE     "force_ssl_cookies_secure"
 #define RC_FORCE_SSL_PROMPT             "force_ssl_prompt"
 #define RC_FORMS_OPTIONS                "forms_options"
+#define RC_FTP_FORMAT                   "ftp_format"
 #define RC_FTP_PASSIVE                  "ftp_passive"
 #define RC_FTP_PROXY                    "ftp_proxy"
 #define RC_GLOBAL_EXTENSION_MAP         "global_extension_map"
diff --git a/src/UCdomap.c b/src/UCdomap.c
index bc2dccda..e6f0de3f 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: UCdomap.c,v 1.70 2008/12/26 00:10:51 tom Exp $
+ * $LynxId: UCdomap.c,v 1.71 2008/12/26 16:36:57 tom Exp $
  *
  *  UCdomap.c
  *  =========
@@ -1982,6 +1982,8 @@ void UC_Charset_Setup(const char *UC_MIMEcharset,
 						   UC_MIMEcharset,
 						   UC_LYNXcharset,
 						   lowest_eight);
+    CTRACE2(TRACE_CFG, (tfp, "registered charset %d mime \"%s\" lynx \"%s\"\n",
+			s, UC_MIMEcharset, UC_LYNXcharset));
     UCInfo[s].uc_status = status;
     if (found < 0)
 	UCNumCharsets++;
diff --git a/src/Xsystem.c b/src/Xsystem.c
index ec8a7915..9ce09301 100644
--- a/src/Xsystem.c
+++ b/src/Xsystem.c
@@ -1,4 +1,4 @@
-/* $LynxId: Xsystem.c,v 1.19 2008/12/15 00:21:16 tom Exp $
+/* $LynxId: Xsystem.c,v 1.20 2008/12/29 01:34:31 tom Exp $
  *	like system("cmd") but return with exit code of "cmd"
  *	for Turbo-C/MS-C/LSI-C
  *  This code is in the public domain.
@@ -450,6 +450,19 @@ static void NEAR redunswitch(PRO * p)
     }
 }
 
+/*
+ * Quote the path to make it safe for shell command processing.
+ *  We always quote it not only includes spaces in it.
+ *  At least we should quote paths which include "&".
+ */
+char *quote_pathname(char *pathname)
+{
+    char *result = NULL;
+
+    HTSprintf0(&result, "\"%s\"", pathname);
+    return result;
+}
+
 int xsystem(char *cmd)
 {
     PRO *p, *pn;
diff --git a/src/makefile.in b/src/makefile.in
index 89bdf027..fc4bf7b5 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -1,4 +1,4 @@
-# $LynxId: makefile.in,v 1.54 2008/12/24 18:11:29 tom Exp $
+# $LynxId: makefile.in,v 1.58 2008/12/30 01:18:43 tom Exp $
 # template-makefile for Lynx src directory
 
 SHELL		= @CONFIG_SHELL@
@@ -9,7 +9,7 @@ prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 top_srcdir	= @top_srcdir@
 srcdir		= @srcdir@
-VPATH		= $(srcdir)
+VPATH		= .:$(srcdir)
 
 top_builddir	= ..
 
@@ -71,6 +71,7 @@ COMPRESS_EXT	=@COMPRESS_EXT@
 
 CHARTRANS_OBJS	= UCdomap$o UCAux$o UCAuto$o
 OBJS		= \
+	LYebcdic$o \
 	LYClean$o LYShowInfo$o LYEdit$o LYStrings$o LYMail$o \
 	HTAlert$o GridText$o LYGetFile$o LYMain$o LYMainLoop$o \
 	LYCurses$o LYBookmark$o LYmktime$o LYUtils$o LYOptions$o \
@@ -80,28 +81,26 @@ OBJS		= \
 	LYLeaks$o LYexit$o LYJump$o LYList$o LYCgi$o \
 	LYTraversal$o LYEditmap$o LYCharSets$o LYCharUtils$o \
 	LYMap$o LYCookie$o LYStyle$o LYHash$o LYPrettySrc$o \
-	TRSTable$o $(CHARTRANS_OBJS) @EXTRA_OBJS@ @LIBOBJS@
-
-GEN_OBJS	= parsdate$o 
+	TRSTable$o parsdate$o $(CHARTRANS_OBJS) @EXTRA_OBJS@ @LIBOBJS@
 
 C_SRC		= $(OBJS:$o=.c)
-GEN_SRC		= $(GEN_OBJS:$o=.c)
 
 all: lynx$x
 
 .SUFFIXES : $o .i
 
+# yacc builds .c in target directory, not $(srcdir)
 .c$o:
 @RULE_CC@
-	@ECHO_CC@$(CC) $(CC_OPTS) -c $(srcdir)/$*.c
+	@ECHO_CC@$(CC) $(CC_OPTS) -c $<
 
 .c.i:
 @RULE_CC@
-	@ECHO_CC@$(CPP) -C $(CPP_OPTS) $(srcdir)/$*.c >$@
+	@ECHO_CC@$(CPP) -C $(CPP_OPTS) $< >$@
 
-lynx$x:   message do_chartrans_stuff $(top_builddir)/LYHelp.h $(OBJS) $(GEN_OBJS) $(WWWLIB)
+lynx$x:   message do_chartrans_stuff $(top_builddir)/LYHelp.h $(OBJS) $(WWWLIB)
 	@echo "Linking and creating Lynx executable"
-	$(CC) $(CC_OPTS) $(LDFLAGS) -o $@  $(OBJS) $(GEN_OBJS) $(WWWLIB) $(INTLLIB) $(LDFLAGS) $(LIBS)
+	$(CC) $(CC_OPTS) $(LDFLAGS) -o $@  $(OBJS) $(WWWLIB) $(INTLLIB) $(LDFLAGS) $(LIBS)
 	@echo "Copying Lynx executable into top-level directory"
 	rm -f $(top_builddir)/$@
 	cp $@ $(top_builddir)/
@@ -124,7 +123,6 @@ lint:
 
 clean:
 	rm -f lynx$x core *.core *.leaks *.i *$o *.bak tags TAGS test_*
-	test -f parsdate.y || rm -f parsdate.c
 	cd chrtrans && $(MAKE) clean
 
 tags:
@@ -208,24 +206,20 @@ chrtrans/makeuctb$(BUILD_EXEEXT):
 UCAux$o : UCAux.c $(CMN)UCAux.h $(CMN)UCDefs.h
 LYCookie$o : $(top_srcdir)/userdefs.h
 
+test_mktime.o: $(srcdir)/LYmktime.c
+	$(CC) -o $@ $(CC_OPTS) -DTEST_DRIVER -c $(srcdir)/LYmktime.c
+
 # test-driver for LYmktime
-test_mktime: LYmktime.c parsdate.o
-	$(CC) -o $@ $(CC_OPTS) -DTEST_DRIVER LYmktime.c parsdate.o
+test_mktime: test_mktime.o parsdate.o LYebcdic.o
+	$(CC) -o $@ $(CC_OPTS) test_mktime.o parsdate.o LYebcdic.o
 
-# update generated source
+# update generated source (may be in ".", or srcdir)
 parsdate.c : $(srcdir)/parsdate.y
 	$(YACC)  $(srcdir)/parsdate.y 
+	-rm -f $@
 	mv y.tab.c $@
 
-# allow for regenerating parsdate.c, e.g., for non-ASCII systems, while
-# handling configure --srcdir option.
-parsdate$o: parsdate.c
-	@-rm -f $@
-	-test -f parsdate.c && $(CC) $(CC_OPTS) -c parsdate.c
-	-test -f parsdate.c || $(CC) $(CC_OPTS) -c $(srcdir)/parsdate.c
-	test -f $@
-
 depend : $(TABLES)
-	makedepend -fmakefile -- $(CC_OPTS) -- $(C_SRC) $(GEN_SRC)
+	makedepend -fmakefile -- $(CC_OPTS) -- $(C_SRC)
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/src/parsdate.c b/src/parsdate.c
index bb692ee7..0549a6e3 100644
--- a/src/parsdate.c
+++ b/src/parsdate.c
@@ -33,7 +33,7 @@ static int yygrowstack(void);
 #define YYPREFIX "yy"
 #line 2 "./parsdate.y"
 /*
- *  $LynxId: parsdate.c,v 1.6 2008/12/24 21:13:01 tom Exp $
+ *  $LynxId: parsdate.c,v 1.7 2008/12/27 01:03:28 tom Exp $
  *
  *  This module is adapted and extended from tin, to use for LYmktime().
  *
@@ -802,24 +802,24 @@ date_lex(void)
     for(;;) {
 	/* Get first character after the whitespace. */
 	for(;;) {
-	    while (CTYPE(isspace, TO_LOCAL(*yyInput)))
+	    while (CTYPE(isspace, *yyInput))
 		yyInput++;
-	    c = TO_LOCAL(*yyInput);
+	    c = *yyInput;
 
 	    /* Ignore RFC 822 comments, typically time zone names. */
 	    if (c != LPAREN)
 		break;
 	    for (nesting = 1;
-		 (c = TO_LOCAL(*++yyInput)) != RPAREN || --nesting;
+		 (c = *++yyInput) != RPAREN || --nesting;
 		 ) {
 		if (c == LPAREN) {
 		    nesting++;
 		} else if (!IS7BIT(c) || c == '\0' || c == '\r'
 		        || (c == '\\'
-			 && ((c = TO_LOCAL(*++yyInput)) == '\0'
+			 && ((c = *++yyInput) == '\0'
 			  || !IS7BIT(c)))) {
 		    /* Lexical error: bad comment. */
-		    return TO_ASCII('?');
+		    return '?';
 		}
 	    }
 	    yyInput++;
@@ -830,7 +830,7 @@ date_lex(void)
 	    if (c == '-' || c == '+') {
 		sign = c == '-' ? -1 : 1;
 		yyInput++;
-		if (!CTYPE(isdigit, TO_LOCAL(*yyInput))) {
+		if (!CTYPE(isdigit, *yyInput)) {
 		    /* Return the isolated plus or minus sign. */
 		    --yyInput;
 		    return *yyInput++;
@@ -839,7 +839,7 @@ date_lex(void)
 		sign = 0;
 	    }
 	    for (p = buff;
-		 (c = TO_LOCAL(*yyInput++)) != '\0' && CTYPE(isdigit, c);
+		 (c = *yyInput++) != '\0' && CTYPE(isdigit, c);
 		 ) {
 		if (p < &buff[sizeof buff - 1])
 		    *p++ = c;
@@ -855,7 +855,7 @@ date_lex(void)
 	/* A word? */
 	if (CTYPE(isalpha, c)) {
 	    for (p = buff;
-		 (c = TO_LOCAL(*yyInput++)) == '.' || CTYPE(isalpha, c);
+		 (c = *yyInput++) == '.' || CTYPE(isalpha, c);
 		 ) {
 		if (p < &buff[sizeof buff - 1])
 		    *p++ = CTYPE(isupper, c) ? tolower(c) : c;
diff --git a/src/parsdate.y b/src/parsdate.y
index e4e2c751..fdfdbad2 100644
--- a/src/parsdate.y
+++ b/src/parsdate.y
@@ -1,6 +1,6 @@
 %{
 /*
- *  $LynxId: parsdate.y,v 1.10 2008/12/24 21:12:49 tom Exp $
+ *  $LynxId: parsdate.y,v 1.11 2008/12/27 00:45:40 tom Exp $
  *
  *  This module is adapted and extended from tin, to use for LYmktime().
  *
@@ -777,24 +777,24 @@ date_lex(void)
     for(;;) {
 	/* Get first character after the whitespace. */
 	for(;;) {
-	    while (CTYPE(isspace, TO_LOCAL(*yyInput)))
+	    while (CTYPE(isspace, *yyInput))
 		yyInput++;
-	    c = TO_LOCAL(*yyInput);
+	    c = *yyInput;
 
 	    /* Ignore RFC 822 comments, typically time zone names. */
 	    if (c != LPAREN)
 		break;
 	    for (nesting = 1;
-		 (c = TO_LOCAL(*++yyInput)) != RPAREN || --nesting;
+		 (c = *++yyInput) != RPAREN || --nesting;
 		 ) {
 		if (c == LPAREN) {
 		    nesting++;
 		} else if (!IS7BIT(c) || c == '\0' || c == '\r'
 		        || (c == '\\'
-			 && ((c = TO_LOCAL(*++yyInput)) == '\0'
+			 && ((c = *++yyInput) == '\0'
 			  || !IS7BIT(c)))) {
 		    /* Lexical error: bad comment. */
-		    return TO_ASCII('?');
+		    return '?';
 		}
 	    }
 	    yyInput++;
@@ -805,7 +805,7 @@ date_lex(void)
 	    if (c == '-' || c == '+') {
 		sign = c == '-' ? -1 : 1;
 		yyInput++;
-		if (!CTYPE(isdigit, TO_LOCAL(*yyInput))) {
+		if (!CTYPE(isdigit, *yyInput)) {
 		    /* Return the isolated plus or minus sign. */
 		    --yyInput;
 		    return *yyInput++;
@@ -814,7 +814,7 @@ date_lex(void)
 		sign = 0;
 	    }
 	    for (p = buff;
-		 (c = TO_LOCAL(*yyInput++)) != '\0' && CTYPE(isdigit, c);
+		 (c = *yyInput++) != '\0' && CTYPE(isdigit, c);
 		 ) {
 		if (p < &buff[sizeof buff - 1])
 		    *p++ = c;
@@ -830,7 +830,7 @@ date_lex(void)
 	/* A word? */
 	if (CTYPE(isalpha, c)) {
 	    for (p = buff;
-		 (c = TO_LOCAL(*yyInput++)) == '.' || CTYPE(isalpha, c);
+		 (c = *yyInput++) == '.' || CTYPE(isalpha, c);
 		 ) {
 		if (p < &buff[sizeof buff - 1])
 		    *p++ = CTYPE(isupper, c) ? tolower(c) : c;