about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-05-30 03:32:17 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1999-05-30 03:32:17 -0400
commit18b746ffb0a4f762c7599a15642c3f994024fc5f (patch)
treec5bdd7049a8aaf7a978b26e949b63f21ff20eafa
parent132787852d4cabd16c3fb46ecda9f5f544d60abd (diff)
downloadlynx-snapshots-18b746ffb0a4f762c7599a15642c3f994024fc5f.tar.gz
snapshot of project "lynx", label v2-8-2pre_9
-rw-r--r--CHANGES19
-rwxr-xr-xconfigure4
-rw-r--r--configure.in6
-rw-r--r--lynx.hlp4
-rw-r--r--lynx.man4
-rw-r--r--src/HTAlert.c4
-rw-r--r--src/HTFWriter.c1
-rw-r--r--src/LYCharUtils.c7
-rw-r--r--src/LYGlobalDefs.h1
-rw-r--r--src/LYHistory.c31
-rw-r--r--src/LYMain.c12
-rw-r--r--src/LYUtils.c49
-rw-r--r--src/LYUtils.h4
-rw-r--r--userdefs.h4
14 files changed, 103 insertions, 47 deletions
diff --git a/CHANGES b/CHANGES
index eb1e6d07..aad8cd3d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,24 @@
 Changes since Lynx 2.8 release
 ===============================================================================
 
-1999-05-28 (2.8.2pre.7)
+1999-05-29 (2.8.2pre.9)
+* use StrAllocCopy rather than HTSprintf in LYstore_message() because no
+  formatting is done there; the message may contain formatting controls such as
+  %s (related to bug report by Frederic L W Meunier <fredlwm@urbi.com.br>) -TD
+* add/use function LYRenamedTemp() to update our record of temporary filename
+  when using external decompression program, so we will remove the decompressed
+  file correctly on exit.  This is the usual case if we do not link with zlib
+  (reported by HN) -TD
+* modify LYValidateFilename() to derive original directory preferably from
+  Current_Dir() rather than environment variable $PWD, since the $PWD directory
+  may not be writable if Lynx is invoked from another application rather than
+  directly from the command line -TD
+* add/use function Current_Dir(), to check for failure in getcwd/getwd -TD
+* change ALL_LINGUAS assignment in configure script to use the .po file which
+  actually reside in the po directory, making it simpler to drop/add message
+  files from a distribution of Lynx.  Also, make the assignment contigent on
+  ALL_LINGUAS not being set externally, making it simple to override -TD
+1999-05-28 (2.8.2pre.8)
 * when reloading/reparsing the document with forms, issue a warning only when
   user input is detected (forms content is changed from its default so
   information will be lost).  New function HText_HaveUserChangedForms() is
diff --git a/configure b/configure
index d1ee8fe9..a850ae90 100755
--- a/configure
+++ b/configure
@@ -667,7 +667,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then
 fi
 
 
-ALL_LINGUAS="de es fr it ko nl no pl pt sl sv"
+test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
 
 
 
@@ -3400,7 +3400,7 @@ test $use_our_messages = yes && USE_OUR_MESSAGES=
 
 if test "$USE_INCLUDED_LIBINTL" = yes ; then
         if test "$nls_cv_force_use_gnu_gettext" = yes ; then
-		echo "configure: warning: Using included gettext anyway" 1>&2
+		echo "configure: warning: Using included gettext anyway, since none was found" 1>&2
 		SUB_MAKEFILE="intl/makefile"
 	else
 		INTLDIR_MAKE="#"
diff --git a/configure.in b/configure.in
index ea491fda..e2560f6c 100644
--- a/configure.in
+++ b/configure.in
@@ -11,8 +11,8 @@ AC_CONFIG_HEADER(lynx_cfg.h:config.hin)
 
 CF_CHECK_CACHE
 
-dnl Set of available languages (wishful thinking :-).
-ALL_LINGUAS="de es fr it ko nl no pl pt sl sv"
+dnl Set of available languages (based on source distribution)
+test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
 
 AC_PREFIX_DEFAULT(/usr/local)
 
@@ -127,7 +127,7 @@ SUB_MAKEFILE=
 CF_OUR_MESSAGES
 if test "$USE_INCLUDED_LIBINTL" = yes ; then
         if test "$nls_cv_force_use_gnu_gettext" = yes ; then
-		AC_MSG_WARN(Using included gettext anyway, since none was found)
+		AC_MSG_WARN(Using included gettext anyway[,] since none was found)
 		SUB_MAKEFILE="intl/makefile"
 	else
 		INTLDIR_MAKE="#"
diff --git a/lynx.hlp b/lynx.hlp
index d3d6976b..bc2ca656 100644
--- a/lynx.hlp
+++ b/lynx.hlp
@@ -264,6 +264,10 @@
   -partial
        display partial pages while downloading.
 
+  -partial_thres=NUMBER
+       number of lines to render before repainting display
+       with partial-display logic
+
   -pauth=ID:PASSWD
        set authorization ID and password for a protected proxy
        server at startup.  Be sure to protect any script files
diff --git a/lynx.man b/lynx.man
index 68a3bc9d..2f244c6d 100644
--- a/lynx.man
+++ b/lynx.man
@@ -298,6 +298,10 @@ force numbering of links.
 .B -partial
 display partial pages while downloading.
 .TP
+.B partial_thres\fR=\fINUMBER
+number of lines to render before repainting display
+with partial-display logic
+.TP
 .B -pauth\fR=\fIID\fR:\fIPASSWD
 set authorization ID and password for a protected proxy
 server at startup.  Be sure to protect any script files
diff --git a/src/HTAlert.c b/src/HTAlert.c
index 40d3c3d5..a3a902c2 100644
--- a/src/HTAlert.c
+++ b/src/HTAlert.c
@@ -261,11 +261,11 @@ PUBLIC char * HTPrompt ARGS2(
     char Tmp[200];
 
     Tmp[0] = '\0';
-    Tmp[199] = '\0';
+    Tmp[sizeof(Tmp)-1] = '\0';
 
     _statusline(Msg);
     if (deflt)
-	strncpy(Tmp, deflt, 199);
+	strncpy(Tmp, deflt, sizeof(Tmp)-1);
 
     if (!dump_output_immediately)
 	LYgetstr(Tmp, VISIBLE, sizeof(Tmp), NORECALL);
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index 28a4d1b5..7211c3ef 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -234,6 +234,7 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me)
 #endif /* FNAMES_8_3 */
 		    LYLocalFileToURL (&addr, path);
 		    if (!use_gzread) {
+			LYRenamedTemp(me->anchor->FileCache, path);
 			StrAllocCopy(me->anchor->FileCache, path);
 			StrAllocCopy(me->anchor->content_encoding, "binary");
 		    }
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index bd3110af..717409ce 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -365,12 +365,7 @@ PUBLIC void LYFillLocalFileURL ARGS2(
 	temp2 = HTVMS_wwwName(getenv("PATH"));
 #else
 	char curdir[LY_MAXPATH];
-#if HAVE_GETCWD
-	getcwd (curdir, sizeof(curdir));
-#else
-	getwd (curdir);
-#endif /* NO_GETCWD */
-	temp2 = wwwName(curdir);
+	temp2 = wwwName(Current_Dir(curdir));
 #endif /* VMS */
 	LYAddHtmlSep(href);
 	/*
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index adf37ba6..8e8d49ba 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -134,6 +134,7 @@ extern char *checked_radio;  /* form radio buttons */
 extern char *unchecked_radio;  /* form radio buttons */
 extern char *empty_string;
 extern char *LynxHome;
+extern char *original_dir;
 extern char *startfile;
 extern char *helpfile;
 extern char *helpfilepath;
diff --git a/src/LYHistory.c b/src/LYHistory.c
index ae60493f..65c3874c 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -746,29 +746,20 @@ PUBLIC void LYstore_message2 ARGS2(
 	CONST char *,	message,
 	CONST char *,	argument)
 {
-    char *temp = NULL;
 
-    if (message == NULL)
-	return;
-
-    HTSprintf(&temp, message, (argument == 0) ? "" : argument);
-
-    to_stack(temp);
-
-    return;
+    if (message != NULL) {
+	char *temp = NULL;
+	HTSprintf(&temp, message, (argument == 0) ? "" : argument);
+	to_stack(temp);
+    }
 }
+
 PUBLIC void LYstore_message ARGS1(
 	CONST char *,	message)
 {
-    char *temp = NULL;
-
-    if (message == NULL)
-	return;
-
-    HTSprintf(&temp, message);
-
-    to_stack(temp);
-
-    return;
+    if (message != NULL) {
+	char *temp = NULL;
+	StrAllocCopy(temp, message);
+	to_stack(temp);
+    }
 }
-
diff --git a/src/LYMain.c b/src/LYMain.c
index 9d9d7e03..851b93ae 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -268,6 +268,7 @@ PUBLIC char *bookmark_page = NULL; /* the name of the default bookmark page */
 PUBLIC char *BookmarkPage = NULL;  /* the name of the current bookmark page */
 PUBLIC char *LynxHome = NULL;	/* the default Home HREF. */
 PUBLIC char *homepage = NULL;  /* home page or main screen */
+PUBLIC char *original_dir = NULL; /* the original directory */
 PUBLIC char *startfile = NULL;	/* the first file */
 PUBLIC char *helpfile = NULL;	/* the main help file */
 PUBLIC char *helpfilepath = NULL;   /* the path to the help file set */
@@ -479,6 +480,7 @@ PRIVATE void free_lynx_globals NOARGS
 
     FREE(LynxHome);
     FREE(homepage);
+    FREE(original_dir);
     FREE(startfile);
     FREE(helpfile);
     FREE(helpfilepath);
@@ -1327,6 +1329,16 @@ PUBLIC int main ARGS2(
 #endif /* USE_COLOR_TABLE */
 
     /*
+     *  Set the original directory, used for default download
+     */
+    if (!strcmp(Current_Dir(filename), ".")) {
+	if ((cp = getenv("PWD")) != 0)
+	    StrAllocCopy(original_dir, cp);
+    } else {
+	StrAllocCopy(original_dir, filename);
+    }
+
+    /*
      *	Set the compilation default signature file. - FM
      */
     strcpy(filename, LYNX_SIG_FILE);
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 7b397219..3ede56ab 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -3865,7 +3865,7 @@ PUBLIC void LYConvertToURL ARGS2(
 	 *  Not a SHELL pathspec.  Get the full VMS spec and convert it.
 	 */
 	char *cur_dir = NULL;
-	static char url_file[256], file_name[256], dir_name[256];
+	static char url_file[LY_MAXPATH], file_name[LY_MAXPATH], dir_name[LY_MAXPATH];
 	unsigned long context = 0;
 	$DESCRIPTOR(url_file_dsc, url_file);
 	$DESCRIPTOR(file_name_dsc, file_name);
@@ -4017,8 +4017,7 @@ have_VMS_URL:
 	     *	They want .
 	     */
 	    char curdir[LY_MAXPATH];
-	    getcwd (curdir, sizeof(curdir));
-	    StrAllocCopy(temp, wwwName(curdir));
+	    StrAllocCopy(temp, wwwName(Current_Dir(curdir)));
 	    StrAllocCat(*AllocatedString, temp);
 	    FREE(temp);
 	    CTRACE(tfp, "Converted '%s' to '%s'\n",
@@ -4050,11 +4049,7 @@ have_VMS_URL:
 	    char curdir[LY_MAXPATH];
 	    char *temp2 = NULL;
 	    BOOL is_local = FALSE;
-#if HAVE_GETCWD
-	    getcwd (curdir, sizeof(curdir));
-#else
-	    getwd (curdir);
-#endif /* NO_GETCWD */
+	    Current_Dir (curdir);
 	    /*
 	     *	Concatenate and simplify, trimming any
 	     *	residual relative elements. - FM
@@ -4845,6 +4840,20 @@ PRIVATE void LYHomeDir_free NOARGS
 }
 #endif /* LY_FIND_LEAKS */
 
+PUBLIC char * Current_Dir ARGS1(
+	char *,	pathname)
+{
+    char *result;
+#if HAVE_GETCWD
+    result = getcwd (pathname, LY_MAXPATH);
+#else
+    result = getwd (pathname);
+#endif /* NO_GETCWD */
+    if (result == 0)
+	strcpy(pathname, ".");
+    return pathname;
+}
+
 PUBLIC CONST char * Home_Dir NOARGS
 {
     static CONST char *homedir = NULL;
@@ -5954,6 +5963,7 @@ PUBLIC void LYCloseTempFP ARGS1(
 	if (p->file == fp) {
 	    fclose(p->file);
 	    p->file = 0;
+	    CTRACE(tfp, "...LYCloseTempFP(%s)\n", p->name);
 	    break;
 	}
     }
@@ -6003,6 +6013,24 @@ PUBLIC void LYCleanupTemp NOARGS
 }
 
 /*
+ * We renamed a temporary file.  Keep track so we can remove it on exit.
+ */
+PUBLIC void LYRenamedTemp ARGS2(
+	char *,		oldname,
+	char *,		newname)
+{
+    LY_TEMP *p;
+
+    CTRACE(tfp, "LYRenamedTemp(old=%s, new=%s)\n", oldname, newname);
+    for (p = ly_temp; p != 0; p = p->next) {
+	if (!strcmp(oldname, p->name)) {
+	    StrAllocCopy((p->name), newname);
+	    break;
+	}
+    }
+}
+
+/*
  *  Convert local pathname to www name
  *  (do not bother about file://localhost prefix at this point).
  */
@@ -6089,7 +6117,7 @@ PUBLIC BOOLEAN LYValidateFilename ARGS2(
 	cp = NULL;
     else
 #endif /*  __DJGPP__ || _WINDOWS */
-	cp = getenv("PWD");
+	cp = original_dir;
     }
     else
 #endif /* __EMX__*/
@@ -6179,7 +6207,7 @@ PUBLIC int LYOpenInternalPage ARGS2(
 	FILE **,  fp0,
 	char **, newfile)
 {
-    static char tempfile[256];
+    static char tempfile[LY_MAXPATH];
 
     LYRemoveTemp(tempfile);
     if ((*fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w")) == NULL) {
@@ -6376,6 +6404,7 @@ PUBLIC int LYSystem ARGS1(
 
     fflush(stdout);
     fflush(stderr);
+    CTRACE(tfp, "LYSystem(%s)\n", command);
     CTRACE_FLUSH(tfp);
 
 #ifdef __DJGPP__
diff --git a/src/LYUtils.h b/src/LYUtils.h
index f205eec1..6a507b94 100644
--- a/src/LYUtils.h
+++ b/src/LYUtils.h
@@ -69,14 +69,15 @@ extern FILE *LYNewTxtFile PARAMS((char * name));
 extern FILE *LYOpenScratch PARAMS((char *result, CONST char *prefix));
 extern FILE *LYOpenTemp PARAMS((char *result, CONST char *suffix, CONST char *mode));
 extern FILE *LYReopenTemp PARAMS((char *name));
+extern char *Current_Dir PARAMS((char * pathname));
 extern char *LYPathLeaf PARAMS((char * pathname));
 extern char *LYSysShell NOPARAMS;
 extern char *LYgetXDisplay NOPARAMS;
 extern char *strip_trailing_slash PARAMS((char * my_dirname));
 extern char *wwwName PARAMS((CONST char *pathname));
-extern int LYConsoleInputFD PARAMS((BOOLEAN need_selectable));
 extern int HTCheckForInterrupt NOPARAMS;
 extern int LYCheckForProxyURL PARAMS((char *filename));
+extern int LYConsoleInputFD PARAMS((BOOLEAN need_selectable));
 extern int LYCopyFile PARAMS((char *src, char *dst));
 extern int LYOpenInternalPage PARAMS((FILE **fp0, char **newfile));
 extern int LYSystem PARAMS((char *command));
@@ -105,6 +106,7 @@ extern void LYFakeZap PARAMS((BOOL set));
 extern void LYLocalFileToURL PARAMS((char **target, CONST char *source));
 extern void LYLocalhostAliases_free NOPARAMS;
 extern void LYRemoveTemp PARAMS((char *name));
+extern void LYRenamedTemp PARAMS((char * oldname, char * newname));
 extern void LYTrimHtmlSep PARAMS((char *path));
 extern void LYTrimPathSep PARAMS((char *path));
 extern void LYTrimRelFromAbsPath PARAMS((char *path));
diff --git a/userdefs.h b/userdefs.h
index afc0623d..38118404 100644
--- a/userdefs.h
+++ b/userdefs.h
@@ -1244,12 +1244,12 @@
  * the version definition with the Project Version on checkout.  Just
  * ignore it. - kw */
 /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
-#define LYNX_VERSION "2.8.2pre.8"
+#define LYNX_VERSION "2.8.2pre.9"
 #define LYNX_WWW_HOME "http://lynx.browser.org/"
 #define LYNX_WWW_DIST "http://www.slcc.edu/lynx/current/"
 #define LYNX_RELEASE FALSE
 /* $Format: "#define LYNX_DATE \"$ProjectDate$\""$ */
-#define LYNX_DATE "Fri, 28 May 1999 08:04:01 -0600"
+#define LYNX_DATE "Sat, 29 May 1999 21:27:26 -0600"
 #define LYNX_DATE_OFF 5		/* truncate the automatically-generated date */
 #define LYNX_DATE_LEN 11	/* truncate the automatically-generated date */
 #define LYNX_RELEASE_DATE "1998"