about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rw-r--r--WWW/Library/Implementation/HTNews.c6
-rw-r--r--src/LYPrint.c16
-rw-r--r--src/LYUtils.c121
-rw-r--r--test/cp-1252.html183
5 files changed, 266 insertions, 66 deletions
diff --git a/CHANGES b/CHANGES
index 4d0c5d29..8696b53c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,13 @@
--- $LynxId: CHANGES,v 1.398 2009/05/22 00:29:53 tom Exp $
+-- $LynxId: CHANGES,v 1.400 2009/05/24 23:15:43 tom Exp $
 ===============================================================================
 Changes since Lynx 2.8 release
 ===============================================================================
 
 2009-05-?? (2.8.7pre.3)
+* remove check for -dump option from HTHandleAuthInfo(), allowing Lynx to -dump
+  or -source NNTP urls (report by Dallas E.  Legan II) -TD
+* amend fix for Debian #388622 to allow the user to save names to the home
+  directory, e.g., ~/foo -TD
 * add an Options menu checkbox to tell if Lynx should send a user-agent string. 
   Unless the useragent restriction is set, the default for this checkbox is
   off, so that Lynx will not send the string.  The corresponding setting,
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index 07d723d8..0c5d4054 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTNews.c,v 1.59 2009/05/10 22:53:23 tom Exp $
+ * $LynxId: HTNews.c,v 1.60 2009/05/24 23:11:26 tom Exp $
  *
  *			NEWS ACCESS				HTNews.c
  *			===========
@@ -389,9 +389,9 @@ static NNTPAuthResult HTHandleAuthInfo(char *host)
     int status, tries;
 
     /*
-     * Make sure we have an interactive user and a host.  - FM
+     * Make sure we have a host.  - FM
      */
-    if (dump_output_immediately || !(host && *host))
+    if (isEmpty(host))
 	return NNTPAUTH_ERROR;
 
     /*
diff --git a/src/LYPrint.c b/src/LYPrint.c
index bd881f79..f6dd409d 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -1,4 +1,6 @@
-/* $LynxId: LYPrint.c,v 1.84 2007/07/01 23:39:36 Andrew.Belov Exp $ */
+/*
+ * $LynxId: LYPrint.c,v 1.85 2009/05/24 22:28:27 tom Exp $
+ */
 #include <HTUtils.h>
 #include <HTAccess.h>
 #include <HTList.h>
@@ -288,7 +290,8 @@ static BOOLEAN confirm_by_pages(const char *prompt,
     return TRUE;
 }
 
-static void send_file_to_file(DocInfo *newdoc, char *content_base,
+static void send_file_to_file(DocInfo *newdoc,
+			      char *content_base,
 			      char *sug_filename)
 {
     BOOLEAN FirstRecall = TRUE;
@@ -458,7 +461,8 @@ static void send_file_to_file(DocInfo *newdoc, char *content_base,
     return;
 }
 
-static void send_file_to_mail(DocInfo *newdoc, char *content_base,
+static void send_file_to_mail(DocInfo *newdoc,
+			      char *content_base,
 			      char *content_location)
 {
     static BOOLEAN first_mail_preparsed = TRUE;
@@ -783,7 +787,8 @@ static void send_file_to_mail(DocInfo *newdoc, char *content_base,
     return;
 }
 
-static void send_file_to_printer(DocInfo *newdoc, char *content_base,
+static void send_file_to_printer(DocInfo *newdoc,
+				 char *content_base,
 				 char *sug_filename,
 				 int printer_number)
 {
@@ -945,7 +950,8 @@ static void send_file_to_printer(DocInfo *newdoc, char *content_base,
     return;
 }
 
-static void send_file_to_screen(DocInfo *newdoc, char *content_base,
+static void send_file_to_screen(DocInfo *newdoc,
+				char *content_base,
 				BOOLEAN Lpansi)
 {
     FILE *outfile_fp;
diff --git a/src/LYUtils.c b/src/LYUtils.c
index c9688d90..171c61ca 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYUtils.c,v 1.184 2009/04/09 20:33:31 tom Exp $
+ * $LynxId: LYUtils.c,v 1.185 2009/05/24 22:17:03 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTCP.h>
@@ -6602,8 +6602,9 @@ const char *wwwName(const char *pathname)
 BOOLEAN LYValidateFilename(char *result,
 			   char *given)
 {
-    char *cp;
-    const char *cp2;
+    BOOLEAN code = TRUE;
+    char *cp = NULL;
+    const char *cp2 = NULL;
 
     /*
      * Cancel if the user entered "/dev/null" on Unix, or an "nl:" path on VMS. 
@@ -6611,78 +6612,84 @@ BOOLEAN LYValidateFilename(char *result,
      */
     if (LYIsNullDevice(given)) {
 	/* just ignore it */
-	return FALSE;
-    }
+	code = FALSE;
 #ifdef HAVE_POPEN
-    if (LYIsPipeCommand(given)) {
+    } else if (LYIsPipeCommand(given)) {
 	if (no_shell) {
 	    HTUserMsg(SPAWNING_DISABLED);
-	    return FALSE;
+	    code = FALSE;
+	} else {
+	    LYstrncpy(result, given, LY_MAXPATH);
 	}
-	LYstrncpy(result, given, LY_MAXPATH);
-	return TRUE;
-    }
 #endif
-    if ((cp = FindLeadingTilde(given, TRUE)) != given
-	&& (cp2 = wwwName(Home_Dir())) != 0
-	&& strlen(cp2) + strlen(given) < LY_MAXPATH) {
-	*(cp++) = '\0';
-	strcpy(result, given);
-	LYTrimPathSep(result);
-	strcat(result, cp2);
-	strcat(result, cp);
-	strcpy(given, result);
-    }
-#ifdef VMS
-    if (strchr(given, '/') != NULL) {
-	strcpy(result, HTVMS_name("", given));
-	strcpy(given, result);
-    }
-    if (given[0] != '/'
-	&& strchr(given, ':') == NULL
-	&& strlen(given) < LY_MAXPATH - 13) {
-	strcpy(result, "sys$disk:");
-	if (strchr(given, ']') == NULL)
-	    strcat(result, "[]");
-	strcat(result, given);
     } else {
-	strcpy(result, given);
-    }
+	if ((cp = FindLeadingTilde(given, TRUE)) != 0
+	    && (cp2 = wwwName(Home_Dir())) != 0
+	    && strlen(cp2) + strlen(given) < LY_MAXPATH) {
+	    *(cp++) = '\0';
+	    strcpy(result, given);
+	    LYTrimPathSep(result);
+	    strcat(result, cp2);
+	    strcat(result, cp);
+	    strcpy(given, result);
+	}
+#ifdef VMS
+	if (strchr(given, '/') != NULL) {
+	    strcpy(result, HTVMS_name("", given));
+	    strcpy(given, result);
+	}
+	if (given[0] != '/'
+	    && strchr(given, ':') == NULL
+	    && strlen(given) < LY_MAXPATH - 13) {
+	    strcpy(result, "sys$disk:");
+	    if (strchr(given, ']') == NULL)
+		strcat(result, "[]");
+	    strcat(result, given);
+	} else {
+	    strcpy(result, given);
+	}
 #else
 
 #ifndef __EMX__
-    if (!LYisAbsPath(given)) {
+	if (!LYisAbsPath(given)) {
 #if defined(__DJGPP__) || defined(_WINDOWS)
-	if (strchr(result, ':') != NULL)
-	    cp = NULL;
-	else
+	    if (strchr(result, ':') != NULL)
+		cp = NULL;
+	    else
 #endif /*  __DJGPP__ || _WINDOWS */
-	{
+	    {
 #ifdef SUPPORT_CHDIR
-	    static char buf[LY_MAXPATH];
+		static char buf[LY_MAXPATH];
 
-	    cp = Current_Dir(buf);
+		cp = Current_Dir(buf);
 #else
-	    cp = original_dir;
+		cp = original_dir;
 #endif
-	}
-    } else
+	    }
+	} else
 #endif /* __EMX__ */
-	cp = NULL;
+	    cp = NULL;
 
-    *result = 0;
-    if (cp) {
-	LYTrimPathSep(cp);
-	if (strlen(cp) >= LY_MAXPATH - 2)
-	    return FALSE;
-	sprintf(result, "%s/", cp);
-    }
-    cp = HTSYS_name(given);
-    if (strlen(result) + strlen(cp) >= LY_MAXPATH - 1)
-	return FALSE;
-    strcat(result, cp);
+	*result = 0;
+	if (cp) {
+	    LYTrimPathSep(cp);
+	    if (strlen(cp) >= LY_MAXPATH - 2) {
+		code = FALSE;
+	    } else {
+		sprintf(result, "%s/", cp);
+	    }
+	}
+	if (code) {
+	    cp = HTSYS_name(given);
+	    if (strlen(result) + strlen(cp) >= LY_MAXPATH - 1) {
+		code = FALSE;
+	    } else {
+		strcat(result, cp);
+	    }
+	}
 #endif /* VMS */
-    return TRUE;
+    }
+    return code;
 }
 
 /*
diff --git a/test/cp-1252.html b/test/cp-1252.html
new file mode 100644
index 00000000..1fd1b0d3
--- /dev/null
+++ b/test/cp-1252.html
@@ -0,0 +1,183 @@
+<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 3.0//EN">
+<HTML>
+<HEAD>
+<TITLE>Character table for cp-1252</TITLE>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=cp-1252">
+<LINK REV="made" HREF="mailto:lynx-dev@nongnu.org">
+<LINK REV="owner" HREF="http://mail.gnu.org/mailman/listinfo/lynx-dev/">
+<LINK REL="sibling" HREF="iso8859-1.html" TITLE="iso-8859-1 test">
+<LINK REL="sibling" HREF="ALT88592.html"  TITLE="iso-8859-2 ALT test">
+</HEAD>
+
+<BODY> 
+
+<H1 ALIGN=center>cp-1252 table</H1> 
+
+<PRE>
+Description                                 Code            Entity name   
+===================================         ============    ==============
+quotation mark                              &amp;#34;  --> &#34;     &amp;quot;   --> &quot;
+ampersand                                   &amp;#38;  --> &#38;     &amp;amp;    --> &amp;
+less-than sign                              &amp;#60;  --> &#60;     &amp;lt;     --> &lt;
+greater-than sign                           &amp;#62;  --> &#62;     &amp;gt;     --> &gt;
+
+Description                            Char Code            Entity name   
+===================================    ==== ============    ==============
+euro sign                                  &amp;128; --> &#128;
+undefined                                  &amp;129; --> &#129;
+single low-9 quotation mark                &amp;130; --> &#130;
+latin small letter f with hook             &amp;131; --> &#131;
+double low-9 quotation mark                &amp;132; --> &#132;
+horizontal ellipsis                        &amp;133; --> &#133;
+dagger                                     &amp;134; --> &#134;
+double dagger                              &amp;135; --> &#135;
+modifier letter circumflex accent          &amp;136; --> &#136;
+per mille sign                             &amp;137; --> &#137;
+latin capital letter s with caron          &amp;138; --> &#138;
+single left-pointing angle quote mark      &amp;139; --> &#139;
+latin capital ligature oe                  &amp;140; --> &#140;
+undefined                                  &amp;141; --> &#141;
+latin capital letter z with caron          &amp;142; --> &#142;
+undefined                                  &amp;143; --> &#143;
+
+undefined                                  &amp;144; --> &#144;
+left single quotation mark                 &amp;145; --> &#145;
+right single quotation mark                &amp;146; --> &#146;
+left double quotation mark                 &amp;147; --> &#147;
+right double quotation mark                &amp;148; --> &#148;
+bullet                                     &amp;149; --> &#149;
+en dash                                    &amp;150; --> &#150;
+em dash                                    &amp;151; --> &#151;
+small tilde                                &amp;152; --> &#152;
+trade mark sign                            &amp;153; --> &#153;
+latin small letter s with caron            &amp;154; --> &#154;
+single right-pointing angle quote mark     &amp;155; --> &#155;
+latin small ligature oe                    &amp;156; --> &#156;
+undefined                                  &amp;157; --> &#157;
+latin small letter z with caron            &amp;158; --> &#158;
+latin capital letter y with diaeresis      &amp;159; --> &#159;
+
+non-breaking space                         &amp;#160; --> &#160;    &amp;nbsp;   --> &nbsp;
+inverted exclamation                       &amp;#161; --> &#161;    &amp;iexcl;  --> &iexcl;
+cent sign                                  &amp;#162; --> &#162;    &amp;cent;   --> &cent;
+pound sterling                             &amp;#163; --> &#163;    &amp;pound;  --> &pound;
+general currency sign                      &amp;#164; --> &#164;    &amp;curren; --> &curren;
+yen sign                                   &amp;#165; --> &#165;    &amp;yen;    --> &yen;
+broken vertical bar                        &amp;#166; --> &#166;    &amp;brvbar; --> &brvbar;
+section sign                               &amp;#167; --> &#167;    &amp;sect;   --> &sect;
+umlaut (dieresis)                          &amp;#168; --> &#168;    &amp;uml;    --> &uml;
+copyright                                  &amp;#169; --> &#169;    &amp;copy;   --> &copy;
+feminine ordinal                           &amp;#170; --> &#170;    &amp;ordf;   --> &ordf;
+left angle quote, guillemotleft            &amp;#171; --> &#171;    &amp;laquo;  --> &laquo;
+not sign                                   &amp;#172; --> &#172;    &amp;not;    --> &not;
+soft hyphen                                &amp;#173; --> &#173;    &amp;shy;    --> &shy;
+registered trademark                       &amp;#174; --> &#174;    &amp;reg;    --> &reg;
+macron accent                              &amp;#175; --> &#175;    &amp;macr;   --> &macr;
+
+degree sign                                &amp;#176; --> &#176;    &amp;deg;    --> &deg;
+plus or minus                              &amp;#177; --> &#177;    &amp;plusmn; --> &plusmn;
+superscript two                            &amp;#178; --> &#178;    &amp;sup2;   --> &sup2;
+superscript three                          &amp;#179; --> &#179;    &amp;sup3;   --> &sup3;
+acute accent                               &amp;#180; --> &#180;    &amp;acute;  --> &acute;
+micro sign                                 &amp;#181; --> &#181;    &amp;micro;  --> &micro;
+paragraph sign                             &amp;#182; --> &#182;    &amp;para;   --> &para;
+middle dot                                 &amp;#183; --> &#183;    &amp;middot; --> &middot;
+cedilla                                    &amp;#184; --> &#184;    &amp;cedil;  --> &cedil;
+superscript one                            &amp;#185; --> &#185;    &amp;sup1;   --> &sup1;
+masculine ordinal                          &amp;#186; --> &#186;    &amp;ordm;   --> &ordm;
+right angle quote, guillemotright          &amp;#187; --> &#187;    &amp;raquo;  --> &raquo;
+vulgar fraction one-quarter                &amp;#188; --> &#188;    &amp;frac14; --> &frac14;
+vulgar fraction one-half                   &amp;#189; --> &#189;    &amp;frac12; --> &frac12;
+vulgar fraction three-fourths              &amp;#190; --> &#190;    &amp;frac34; --> &frac34;
+inverted question mark                     &amp;#191; --> &#191;    &amp;iquest; --> &iquest;
+
+latin capital letter a with grave          &amp;#192; --> &#192;    &amp;Agrave; --> &Agrave;
+latin capital letter a with acute          &amp;#193; --> &#193;    &amp;Aacute; --> &Aacute;
+latin capital letter a with circumflex     &amp;#194; --> &#194;    &amp;Acirc;  --> &Acirc;
+latin capital letter a with tilde          &amp;#195; --> &#195;    &amp;Atilde; --> &Atilde;
+latin capital letter a with diaeresis      &amp;#196; --> &#196;    &amp;Auml;   --> &Auml;
+latin capital letter a with ring above     &amp;#197; --> &#197;    &amp;Aring;  --> &Aring;
+latin capital letter ae                    &amp;#198; --> &#198;    &amp;AElig;  --> &AElig;
+latin capital letter c with cedilla        &amp;#199; --> &#199;    &amp;Ccedil; --> &Ccedil;
+latin capital letter e with grave          &amp;#200; --> &#200;    &amp;Egrave; --> &Egrave;
+latin capital letter e with acute          &amp;#201; --> &#201;    &amp;Eacute; --> &Eacute;
+latin capital letter e with circumflex     &amp;#202; --> &#202;    &amp;Ecirc;  --> &Ecirc;
+latin capital letter e with diaeresis      &amp;#203; --> &#203;    &amp;Euml;   --> &Euml;
+latin capital letter i with grave          &amp;#204; --> &#204;    &amp;Igrave; --> &Igrave;
+latin capital letter i with acute          &amp;#205; --> &#205;    &amp;Iacute; --> &Iacute;
+latin capital letter i with circumflex     &amp;#206; --> &#206;    &amp;Icirc;  --> &Icirc;
+latin capital letter i with diaeresis      &amp;#207; --> &#207;    &amp;Iuml;   --> &Iuml;
+
+latin capital letter eth                   &amp;#208; --> &#208;    &amp;ETH;    --> &ETH;
+latin capital letter n with tilde          &amp;#209; --> &#209;    &amp;Ntilde; --> &Ntilde;
+latin capital letter o with grave          &amp;#210; --> &#210;    &amp;Ograve; --> &Ograve;
+latin capital letter o with acute          &amp;#211; --> &#211;    &amp;Oacute; --> &Oacute;
+latin capital letter o with circumflex     &amp;#212; --> &#212;    &amp;Ocirc;  --> &Ocirc;
+latin capital letter o with tilde          &amp;#213; --> &#213;    &amp;Otilde; --> &Otilde;
+latin capital letter o with diaeresis      &amp;#214; --> &#214;    &amp;Ouml;   --> &Ouml;
+multiplication sign                        &amp;#215; --> &#215;    &amp;times;  --> &times;
+latin capital letter o with stroke         &amp;#216; --> &#216;    &amp;Oslash; --> &Oslash;
+latin capital letter u with grave          &amp;#217; --> &#217;    &amp;Ugrave; --> &Ugrave;
+latin capital letter u with acute          &amp;#218; --> &#218;    &amp;Uacute; --> &Uacute;
+latin capital letter u with circumflex     &amp;#219; --> &#219;    &amp;Ucirc;  --> &Ucirc;
+latin capital letter u with diaeresis      &amp;#220; --> &#220;    &amp;Uuml;   --> &Uuml;
+latin capital letter y with acute          &amp;#221; --> &#221;    &amp;Yacute; --> &Yacute;
+latin capital letter thorn                 &amp;#222; --> &#222;    &amp;THORN;  --> &THORN;
+latin small letter sharp s                 &amp;#223; --> &#223;    &amp;szlig;  --> &szlig;
+
+latin small letter a with grave            &amp;#224; --> &#224;    &amp;agrave; --> &agrave;
+latin small letter a with acute            &amp;#225; --> &#225;    &amp;aacute; --> &aacute;
+latin small letter a with circumflex       &amp;#226; --> &#226;    &amp;acirc;  --> &acirc;
+latin small letter a with tilde            &amp;#227; --> &#227;    &amp;atilde; --> &atilde;
+latin small letter a with diaeresis        &amp;#228; --> &#228;    &amp;auml;   --> &auml;
+latin small letter a with ring above       &amp;#229; --> &#229;    &amp;aring;  --> &aring;
+latin small letter ae                      &amp;#230; --> &#230;    &amp;aelig;  --> &aelig;
+latin small letter c with cedilla          &amp;#231; --> &#231;    &amp;ccedil; --> &ccedil;
+latin small letter e with grave            &amp;#232; --> &#232;    &amp;egrave; --> &egrave;
+latin small letter e with acute            &amp;#233; --> &#233;    &amp;eacute; --> &eacute;
+latin small letter e with circumflex       &amp;#234; --> &#234;    &amp;ecirc;  --> &ecirc;
+latin small letter e with diaeresis        &amp;#235; --> &#235;    &amp;euml;   --> &euml;
+latin small letter i with grave            &amp;#236; --> &#236;    &amp;igrave; --> &igrave;
+latin small letter i with acute            &amp;#237; --> &#237;    &amp;iacute; --> &iacute;
+latin small letter i with circumflex       &amp;#238; --> &#238;    &amp;icirc;  --> &icirc;
+latin small letter i with diaeresis        &amp;#239; --> &#239;    &amp;iuml;   --> &iuml;
+
+latin small letter eth                     &amp;#240; --> &#240;    &amp;eth;    --> &eth;
+latin small letter n with tilde            &amp;#241; --> &#241;    &amp;ntilde; --> &ntilde;
+latin small letter o with grave            &amp;#242; --> &#242;    &amp;ncaron; --> &ncaron;
+latin small letter o with acute            &amp;#243; --> &#243;    &amp;oacute; --> &oacute;
+latin small letter o with circumflex       &amp;#244; --> &#244;    &amp;ocirc;  --> &ocirc;
+latin small letter o with tilde            &amp;#245; --> &#245;    &amp;otilde; --> &otilde;
+latin small letter o with diaeresis        &amp;#246; --> &#246;    &amp;ouml;   --> &ouml;
+division sign                              &amp;#247; --> &#247;    &amp;divide; --> &divide;
+latin small letter o with stroke           &amp;#248; --> &#248;    &amp;oslash; --> &oslash;
+latin small letter u with grave            &amp;#249; --> &#249;    &amp;ugrave; --> &ugrave;
+latin small letter u with acute            &amp;#250; --> &#250;    &amp;uacute; --> &uacute;
+latin small letter u with circumflex       &amp;#251; --> &#251;    &amp;ucirc;  --> &ucirc;
+latin small letter u with diaeresis        &amp;#252; --> &#252;    &amp;uuml;   --> &uuml;
+latin small letter y with acute            &amp;#253; --> &#253;    &amp;yacute; --> &yacute;
+latin small letter thorn                   &amp;#254; --> &#254;    &amp;thorn;  --> &thorn;
+latin small letter y with diaeresis   {}  {&amp;#255;}-->{&#255;}  {&amp;yuml;}  -->{&yuml;}
+
+Some other characters of interest      Char Code            Entity name   
+===================================    ==== ============    ==============
+capital AE diphthong (ligature)        N/A  &amp;#198; --> &#198;    &amp;AElig;  --> &AElig;
+small ae diphthong (ligature)          N/A  &amp;#230; --> &#230;    &amp;aelig;  --> &aelig;
+capital OE ligature                    N/A {&amp;#338;}-->{&#338;}  {&amp;OElig;} -->{&OElig;}
+small oe ligature                      N/A {&amp;#339;}-->{&#339;}  {&amp;oelig;} -->{&oelig;}
+copyright                              N/A  &amp;#169; --> &#169;    &amp;copy;   --> &copy;
+registered trademark                   N/A  &amp;#174; --> &#174;    &amp;reg;    --> &reg;
+trademark sign                         N/A  &amp;#8482;--> &#8482;   &amp;trade;  --> &trade;
+em space                               N/A [&amp;#8195;]->[&#8195;] [&amp;emsp;]  -->[&emsp;]
+en space                               N/A [&amp;#8194;]->[&#8194;] [&amp;ensp;]  -->[&ensp;]
+1/3-em space                           N/A [&amp;#8196;]->[&#8196;] [&amp;emsp13;] -->[&emsp13;]
+1/4-em space                           N/A [&amp;#8197;]->[&#8197;] [&amp;emsp14;] -->[&emsp14;]
+thin space                             N/A [&amp;#8201;]->[&#8201;] [&amp;thinsp;]-->[&thinsp;]
+hair space                             N/A [&amp;#8202;]->[&#8202;] [&amp;hairsp;]-->[&hairsp;]
+em dash                                N/A [&amp;#8212;]->[&#8212;] [&amp;mdash;] -->[&mdash;]
+en dash                                N/A [&amp;#8211;]->[&#8211;] [&amp;ndash;] -->[&ndash;]
+
+</PRE>
+
+</BODY>
+</HTML>