about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rwxr-xr-xconfigure2
-rw-r--r--configure.in4
-rw-r--r--lynx.cfg4
-rw-r--r--src/GridText.c8
-rw-r--r--src/LYUtils.c35
-rw-r--r--userdefs.h4
7 files changed, 34 insertions, 29 deletions
diff --git a/CHANGES b/CHANGES
index 996c869d..3e2123aa 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
 Changes since Lynx 2.8 release
 ===============================================================================
 
+2006-11-14 (2.8.7dev.4)
+* use RFC-822 encoding for filenames passed via file-upload forms (Debian
+  #181165) -TD
+* correct check of return-value from FindLeadingTilde() in dev.3 cleanup of
+  "~" parsing -TD
+
 2006-11-12 (2.8.7dev.3)
 * change the default HELPFILE to the 2.8.6 release directory since the
   page on subir.com contains obsolete information -TD
diff --git a/configure b/configure
index 3dc12ed9..49a4a086 100755
--- a/configure
+++ b/configure
@@ -1228,7 +1228,7 @@ fi;
 
 PACKAGE=lynx
 # $Format: "VERSION=$ProjectVersion$"$
-VERSION=2.8.7dev.2
+VERSION=2.8.7dev.4
 
 test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
 
diff --git a/configure.in b/configure.in
index ccb1ff82..c4998459 100644
--- a/configure.in
+++ b/configure.in
@@ -25,7 +25,7 @@ dnl ---------------------------------------------------------------------------
 dnl
 dnl ask PRCS to plug-in the project-version for the configure-script.
 dnl $Format: "AC_REVISION($ProjectVersion$)"$
-AC_REVISION(2.8.7dev.2)
+AC_REVISION(2.8.7dev.4)
 
 # Save the original $CFLAGS so we can distinguish whether the user set those
 # in the environment, or whether autoconf added -O and -g options:
@@ -57,7 +57,7 @@ AC_ARG_WITH(system-type,
 PACKAGE=lynx
 dnl ask PRCS to plug-in the project-version for the packages.
 # $Format: "VERSION=$ProjectVersion$"$
-VERSION=2.8.7dev.2
+VERSION=2.8.7dev.4
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
 AC_SUBST(DESTDIR)
diff --git a/lynx.cfg b/lynx.cfg
index d311eadc..ab8e6692 100644
--- a/lynx.cfg
+++ b/lynx.cfg
@@ -3,10 +3,10 @@
 #                                     or Lynx_Dir:lynx.cfg (VMS)
 #
 # $Format: "#PRCS LYNX_VERSION \"$ProjectVersion$\""$
-#PRCS LYNX_VERSION "2.8.7dev.2"
+#PRCS LYNX_VERSION "2.8.7dev.4"
 #
 # $Format: "#PRCS LYNX_DATE \"$ProjectDate$\""$
-#PRCS LYNX_DATE "Mon, 06 Nov 2006 17:14:13 -0800"
+#PRCS LYNX_DATE "Tue, 14 Nov 2006 17:12:30 -0800"
 #
 # Definition pairs are of the form  VARIABLE:DEFINITION
 # NO spaces are allowed between the pair items.
diff --git a/src/GridText.c b/src/GridText.c
index c1b93045..c99011f5 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -11422,11 +11422,17 @@ int HText_SubmitForm(FormInfo * submit_item, DocInfo *doc, char *link_name,
 		    StrAllocCopy(escaped1, my_data[anchor_count].name);
 		} else if (Boundary) {
 		    const char *t = guess_content_type(val_used);
+		    char *copied_fname = NULL;
 
 		    StrAllocCopy(escaped1, "Content-Disposition: form-data");
 		    HTSprintf(&escaped1, "; name=\"%s\"",
 			      my_data[anchor_count].name);
-		    HTSprintf(&escaped1, "; filename=\"%s\"", val_used);
+
+		    StrAllocCopy(copied_fname, val_used);
+		    HTMake822Word(&copied_fname, FALSE);
+		    HTSprintf(&escaped1, "; filename=\"%s\"", copied_fname);
+		    FREE(copied_fname);
+
 		    /* Should we take into account the encoding? */
 		    HTSprintf(&escaped1, "\r\nContent-Type: %s", t);
 		    if (my_data[anchor_count].quote == QUOTE_BASE64)
diff --git a/src/LYUtils.c b/src/LYUtils.c
index c4b3a9f1..07802c20 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -37,11 +37,17 @@ int kbhit(void);		/* FIXME: use conio.h */
 #endif
 
 #ifdef _WINDOWS			/* 1998/04/30 (Thu) 19:04:25 */
-#define GETPID()	(getpid() & 0xffff)
+#define GETPID()	(unsigned) (getpid() & 0xffff)
 #else
-#define GETPID()	getpid()
+#define GETPID()	(unsigned) getpid()
 #endif /* _WINDOWS */
 
+#ifdef FNAMES_8_3
+#define PID_FMT "%04x"
+#else
+#define PID_FMT "%u"
+#endif
+
 #ifdef DJGPP_KEYHANDLER
 #include <bios.h>
 #endif /* DJGPP_KEYHANDLER */
@@ -3065,19 +3071,11 @@ void change_sug_filename(char *fname)
      * Rename any temporary files.
      */
     cp2 = wwwName(lynx_temp_space);
-#ifdef FNAMES_8_3
     if (LYIsHtmlSep(*cp2)) {
-	HTSprintf0(&temp, "file://localhost%s%04x", cp2, GETPID());
+	HTSprintf0(&temp, "file://localhost%s" PID_FMT, cp2, GETPID());
     } else {
-	HTSprintf0(&temp, "file://localhost/%s%04x", cp2, GETPID());
+	HTSprintf0(&temp, "file://localhost/%s" PID_FMT, cp2, GETPID());
     }
-#else
-    if (LYIsHtmlSep(*cp2)) {
-	HTSprintf0(&temp, "file://localhost%s%d", cp2, (int) getpid());
-    } else {
-	HTSprintf0(&temp, "file://localhost/%s%d", cp2, (int) getpid());
-    }
-#endif
     if (!strncmp(fname, temp, strlen(temp))) {
 	cp = strrchr(fname, '.');
 	if (strlen(cp) > (strlen(temp) - 4))
@@ -3403,11 +3401,7 @@ static int fmt_tempname(char *result,
      * the suffix may contain more than a ".htm", e.g., "-txt.gz", so we trim
      * off from the filename portion to make room.
      */
-#ifdef _WINDOWS
-    sprintf(leaf, "%04x%04x", counter, (unsigned) GETPID());
-#else
-    sprintf(leaf, "%u%u", counter, (unsigned) getpid());
-#endif
+    sprintf(leaf, PID_FMT PID_FMT, counter, GETPID());
     if (strlen(leaf) > 8)
 	leaf[8] = 0;
     if (strlen(suffix) > 4 || *suffix != '.') {
@@ -3420,7 +3414,7 @@ static int fmt_tempname(char *result,
     }
     strcat(leaf, suffix);
 #else
-    sprintf(leaf, "L%u-%uTMP%s", (unsigned) getpid(), counter, suffix);
+    sprintf(leaf, "L" PID_FMT "-%uTMP%s", GETPID(), counter, suffix);
 #endif
     /*
      * Someone could have configured the temporary pathname to be too long.
@@ -5370,8 +5364,7 @@ char *LYTildeExpand(char **pathname,
 {
     char *temp = FindLeadingTilde(*pathname, embedded);
 
-    if (temp != NULL
-	&& LYIsTilde(temp[0])) {
+    if (LYIsTilde(temp[0])) {
 
 	CTRACE((tfp, "LYTildeExpand %s\n", *pathname));
 	if (LYIsPathSep(temp[1])
@@ -6750,7 +6743,7 @@ BOOLEAN LYValidateFilename(char *result,
 	return TRUE;
     }
 #endif
-    if ((cp = FindLeadingTilde(given, TRUE)) != 0
+    if ((cp = FindLeadingTilde(given, TRUE)) != given
 	&& (cp2 = wwwName(Home_Dir())) != 0
 	&& strlen(cp2) + strlen(given) < LY_MAXPATH) {
 	*(cp++) = '\0';
diff --git a/userdefs.h b/userdefs.h
index d74c203f..f5972272 100644
--- a/userdefs.h
+++ b/userdefs.h
@@ -1364,11 +1364,11 @@
  * the version definition with the Project Version on checkout.  Just
  * ignore it. - kw */
 /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
-#define LYNX_VERSION "2.8.7dev.2"
+#define LYNX_VERSION "2.8.7dev.4"
 #define LYNX_WWW_HOME "http://lynx.isc.org/"
 #define LYNX_WWW_DIST "http://lynx.isc.org/current/"
 /* $Format: "#define LYNX_DATE \"$ProjectDate$\""$ */
-#define LYNX_DATE "Mon, 06 Nov 2006 17:14:13 -0800"
+#define LYNX_DATE "Tue, 14 Nov 2006 17:12:30 -0800"
 #define LYNX_DATE_OFF 5		/* truncate the automatically-generated date */
 #define LYNX_DATE_LEN 11	/* truncate the automatically-generated date */