aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-10-01 13:29:54 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1998-10-01 13:29:54 -0400
commit24efd81edda1e797719e0f4eb231604d9b273dad (patch)
treec51218c89bcd51df4068ff0d4732b3b5b4a13d6a
parent4fa34a534d3c5600a483a4a0b2f40939dee4ec14 (diff)
downloadlynx-snapshots-24efd81edda1e797719e0f4eb231604d9b273dad.tar.gz
snapshot of project "lynx", label v2-8-1pre_6
-rw-r--r--CHANGES15
-rw-r--r--src/LYBookmark.c8
-rw-r--r--src/LYCurses.h8
-rw-r--r--src/LYDownload.c6
-rw-r--r--src/LYExtern.c2
-rw-r--r--src/LYMain.c8
-rw-r--r--src/LYMainLoop.c19
-rw-r--r--src/LYPrint.c2
-rw-r--r--src/LYUpload.c15
-rw-r--r--src/LYUtils.c83
-rw-r--r--src/LYrcFile.c8
-rw-r--r--userdefs.h4
12 files changed, 104 insertions, 74 deletions
diff --git a/CHANGES b/CHANGES
index 30d9b31c..aa74f585 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,12 +1,23 @@
Changes since Lynx 2.8 release
================================================================================
-1998-09-29 (2.8.1pre.5)
+1998-10-01 (2.8.1pre.6)
+* add EMX to special cases for SetOutputMode, to force stdout to O_BINARY mode
+ so that downloading binary files will not corrupt them (reported by Ilya
+ Zakharevich <ilya@math.ohio-state.edu>) - TD
+* correct missing "\n\" in change to LYrcFile.c for pre.4 (reported by David
+ Eaton) - TD
+* reorder HTCheckForInterrupt() so that partial displace mode will work for
+ VMS (reported by LP) - TD
+* fix LYK_DOWNLOAD to restrict downloading remote links for local_host_only,
+ like it was done for mailto: links recently, see comments where in. - LP
+* replace few statusline messages with ones from LYMessages.en.h
+1998-09-30 (2.8.1pre.5)
* force compile on VMS to use stdarg.h; it was ifdef'd for __STDC__ which
VAX C does not define, though it does support stdarg.h (reported by Tony
Bolton). Test-compile HTVMS_WaisUI.c on Linux to check... - TD
* update url for tcplib in INSTALLATION - DK
-* fix HTDOS_name trace massage - LP
+* fix HTDOS_name trace massage - LP
* expand "~" in include-statements in lynx.cfg (reported by LP) - TD
* remove some obsolete stuff from INSTALLATION - HN
* DOSPATH fix: user input URL like c:/path/file.ext (begins with drive letter)
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index bf6f4b60..7e8f7276 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -291,9 +291,7 @@ PUBLIC void save_bookmark_link ARGS2(
* Create the bookmark file, if it doesn't exist already,
* Otherwise, open the pre-existing bookmark file. - FM
*/
-#if defined(__DJGPP__) || defined(_WINDOWS)
- _fmode = O_TEXT;
-#endif /* __DJGPP__ or _WINDOWS */
+ SetDefaultMode(O_TEXT);
if (first_time) {
/*
* Seek it in the home path. - FM
@@ -355,9 +353,7 @@ Note: if you edit this file manually\n\
}
fclose(fp);
-#if defined(__DJGPP__) || defined(_WINDOWS)
- _fmode = O_BINARY;
-#endif /* __DJGPP__ or _WINDOWS */
+ SetDefaultMode(O_BINARY);
/*
* If this is a cached bookmark file, set nocache for
* it so we'll see the new bookmark link when that
diff --git a/src/LYCurses.h b/src/LYCurses.h
index a0275449..ace10813 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -396,10 +396,16 @@ extern void lynx_stop_all_colors NOPARAMS;
* stdout in BINARY mode by default. Where necessary we should open and
* (close!) TEXT mode.
*/
-#if defined(_WINDOWS) || defined(DJGPP)
+#if defined(_WINDOWS) || defined(DJGPP) || defined(__EMX__)
#define SetOutputMode(mode) setmode(fileno(stdout), mode)
#else
#define SetOutputMode(mode) /* nothing */
#endif
+#if defined(_WINDOWS) || defined(DJGPP)
+#define SetDefaultMode(mode) _fmode = mode
+#else
+#define SetDefaultMode(mode) /* nothing */
+#endif
+
#endif /* LYCURSES_H */
diff --git a/src/LYDownload.c b/src/LYDownload.c
index af02fe41..e55d0dbc 100644
--- a/src/LYDownload.c
+++ b/src/LYDownload.c
@@ -358,16 +358,20 @@ check_recall:
}
chmod(buffer, HIDE_CHMOD);
#else /* Unix: */
+
+#if !( defined(__EMX__) || defined(__DJGPP__) )
/*
* Prevent spoofing of the shell.
*/
-#ifndef __EMX__
cp = quote_pathname(file);
cp1 = quote_pathname(buffer);
sprintf(command, "%s %s %s", COPY_PATH, cp, cp1);
FREE(cp);
FREE(cp1);
#else
+ /* DJGPP: no " or space possible in 8+3 dos filenames. */
+ /* (but EMX probably allows spaces which should be quoted, */
+ /* like Win32 LFN does...) */
sprintf(command, "%s %s %s", COPY_PATH, file, buffer);
#endif /* __EMX__ */
CTRACE(tfp, "command: %s\n", command);
diff --git a/src/LYExtern.c b/src/LYExtern.c
index 8b6959e9..329fe103 100644
--- a/src/LYExtern.c
+++ b/src/LYExtern.c
@@ -57,7 +57,7 @@ void run_external ARGS1(char *, c)
*/
#if defined(VMS) || defined(DOSPATH) || defined(__EMX__)
sprintf(command, externals2->command, c);
-#else /* Unix or DOS/Win: */
+#else /* Unix: */
cp = quote_pathname(c);
sprintf(command, externals2->command, cp);
FREE(cp);
diff --git a/src/LYMain.c b/src/LYMain.c
index e8c98418..49d6d3e5 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -35,6 +35,10 @@
#include <dos.h>
#endif /* __DJGPP__ */
+#ifdef __EMX__
+#include <io.h>
+#endif
+
#ifndef VMS
#ifdef SYSLOG_REQUESTED_URLS
#include <syslog.h>
@@ -559,16 +563,14 @@ PUBLIC int main ARGS2(
sock_init();
#endif
-#if defined(_WINDOWS) || defined(DJGPP)
/*
* To prevent corrupting binary data with _WINDOWS and DJGPP
* we open files and stdout in BINARY mode by default.
* Where necessary we should open and (close!) TEXT mode.
* (use LYNewTxtFile/LYAppendToTxtFile to open text files for writing)
*/
- _fmode = O_BINARY;
+ SetDefaultMode(O_BINARY);
SetOutputMode( O_BINARY );
-#endif
#ifdef DOSPATH
if (getenv("TERM")==NULL) putenv("TERM=vt100");
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index e5b44d62..51c0fd88 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -42,6 +42,10 @@
#include <LYExtern.h>
#endif
+#ifdef __EMX__
+#include <io.h>
+#endif
+
#ifdef VMS
#include <HTVMSUtils.h>
#endif /* VMS */
@@ -4959,6 +4963,21 @@ check_add_bookmark_to_self:
"mailto:", 7)) {
HTUserMsg(NO_DOWNLOAD_MAILTO_LINK);
+ /*
+ * From here on we could have a remote host, so check if
+ * that's allowed.
+ *
+ * We copy all these checks from getfile() to LYK_DOWNLOAD
+ * here because LYNXDOWNLOAD:// will NOT be pushing the
+ * previous document into the history stack so preserve
+ * getfile() from returning a wrong status (NULLFILE).
+ */
+ } else if (local_host_only &&
+ !(LYisLocalHost(links[curdoc.link].lname) ||
+ LYisLocalAlias(links[curdoc.link].lname))) {
+ HTUserMsg(ACCESS_ONLY_LOCALHOST);
+
+
} else { /* Not a forms, options or history link */
/*
* Follow a normal link or anchor. Note that
diff --git a/src/LYPrint.c b/src/LYPrint.c
index 91fd2f82..c4eea6e0 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -1136,7 +1136,7 @@ PUBLIC int printfile ARGS1(
HTAddSugFilename(filename);
}
-#if defined (VMS) || defined (__EMX__)
+#if defined (VMS) || defined (__EMX__) || defined(__DJGPP__)
sprintf(buffer, cur_printer->command, tempfile, filename,
"", "", "", "", "", "", "", "", "", "");
#else /* Unix: */
diff --git a/src/LYUpload.c b/src/LYUpload.c
index 825d0e19..c9488e22 100644
--- a/src/LYUpload.c
+++ b/src/LYUpload.c
@@ -93,7 +93,7 @@ PUBLIC int LYUpload ARGS1(
* Commands have the form "command %s [etc]"
* where %s is the filename.
*/
- _statusline("Enter a filename: ");
+ _statusline(FILENAME_PROMPT);
retry:
*tmpbuf = '\0';
if (LYgetstr(tmpbuf, VISIBLE, sizeof(tmpbuf), NORECALL) < 0)
@@ -129,9 +129,9 @@ retry:
fclose(fp);
#ifdef VMS
- _statusline("File exists. Create higher version? (y/n)");
+ _statusline(FILE_EXISTS_HPROMPT);
#else
- _statusline("File exists. Overwrite? (y/n)");
+ _statusline(FILE_EXISTS_OPROMPT);
#endif /* VMS */
c = 0;
while (TOUPPER(c) != 'Y' && TOUPPER(c) != 'N' && c != 7 && c != 3)
@@ -148,7 +148,7 @@ retry:
}
if (TOUPPER(c) == 'N') {
- _statusline("Enter a filename: ");
+ _statusline(NEW_FILENAME_PROMPT);
goto retry;
}
}
@@ -156,15 +156,18 @@ retry:
/*
* See if we can write to it.
*/
+ CTRACE(tfp, "LYUpload: filename is %s", buffer);
+
if ((fp = fopen(buffer, "w")) != NULL) {
fclose(fp);
remove(buffer);
} else {
- _statusline("Cannot write to file. Enter a new filename: ");
+ HTAlert(CANNOT_WRITE_TO_FILE);
+ _statusline(NEW_FILENAME_PROMPT);
goto retry;
}
-#if defined (VMS) || defined (__EMX__)
+#if defined (VMS) || defined (__EMX__) || defined(__DJGPP__)
sprintf(tmpbuf, upload_command->command, buffer, "", "", "", "", "");
#else
cp = quote_pathname(buffer); /* to prevent spoofing of the shell */
diff --git a/src/LYUtils.c b/src/LYUtils.c
index d14b0b48..ac66b7f7 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -2031,8 +2031,8 @@ PUBLIC void LYFakeZap ARGS1(
PUBLIC int HTCheckForInterrupt NOARGS
{
-#ifndef VMS /* UNIX stuff: */
int c;
+#ifndef VMS /* UNIX stuff: */
#ifndef USE_SLANG
struct timeval socket_timeout;
int ret = 0;
@@ -2095,6 +2095,37 @@ PUBLIC int HTCheckForInterrupt NOARGS
#if defined (DOSPATH) && defined (NCURSES)
nodelay(stdscr,FALSE);
#endif /* DOSPATH */
+
+#else /* VMS: */
+ extern BOOLEAN HadVMSInterrupt;
+ extern int typeahead();
+
+ if (fake_zap > 0) {
+ fake_zap--;
+ CTRACE(tfp, "\r *** Got simulated 'Z' ***\n");
+ CTRACE_FLUSH(tfp);
+ CTRACE_SLEEP(AlertSecs);
+ return((int)TRUE);
+ }
+
+ /** Curses or slang setup was not invoked **/
+ if (dump_output_immediately)
+ return((int)FALSE);
+
+ /** Control-C or Control-Y and a 'N'o reply to exit query **/
+ if (HadVMSInterrupt) {
+ HadVMSInterrupt = FALSE;
+ return((int)TRUE);
+ }
+
+ /** Keyboard 'Z' or 'z', or Control-G or Control-C **/
+ c = typeahead();
+
+#endif /* !VMS */
+
+ /*
+ * 'c' contains whatever character we're able to read from type-ahead
+ */
if (TOUPPER(c) == 'Z' || c == 7 || c == 3)
return((int)TRUE);
#ifdef DISP_PARTIAL
@@ -2147,42 +2178,8 @@ PUBLIC int HTCheckForInterrupt NOARGS
HText_pageDisplay(Newline_partial, "");
}
#endif /* DISP_PARTIAL */
-
- /** Other keystrokes **/
- return((int)FALSE);
-
-#else /* VMS: */
-
- int c;
- extern BOOLEAN HadVMSInterrupt;
- extern int typeahead();
-
- if (fake_zap > 0) {
- fake_zap--;
- CTRACE(tfp, "\r *** Got simulated 'Z' ***\n");
- CTRACE_FLUSH(tfp);
- CTRACE_SLEEP(AlertSecs);
- return((int)TRUE);
- }
-
- /** Curses or slang setup was not invoked **/
- if (dump_output_immediately)
- return((int)FALSE);
-
- /** Control-C or Control-Y and a 'N'o reply to exit query **/
- if (HadVMSInterrupt) {
- HadVMSInterrupt = FALSE;
- return((int)TRUE);
- }
-
- /** Keyboard 'Z' or 'z', or Control-G or Control-C **/
- c = typeahead();
- if (TOUPPER(c) == 'Z' || c == 7 || c == 3)
- return((int)TRUE);
-
/** Other or no keystrokes **/
return((int)FALSE);
-#endif /* !VMS */
}
/*
@@ -5549,15 +5546,11 @@ PUBLIC FILE *LYNewTxtFile ARGS1(char *, name)
fp = fopen (name, "w", "shr=get");
chmod(name, HIDE_CHMOD);
#else
-#if defined(__DJGPP__) || defined(_WINDOWS)
- _fmode = O_TEXT;
-#endif /* __DJGPP__ or _WINDOWS */
+ SetDefaultMode(O_TEXT);
fp = OpenHiddenFile(name, "w");
-#if defined(__DJGPP__) || defined(_WINDOWS)
- _fmode = O_BINARY;
-#endif /* __DJGPP__ or _WINDOWS */
+ SetDefaultMode(O_BINARY);
#endif
return fp;
@@ -5571,15 +5564,11 @@ PUBLIC FILE *LYAppendToTxtFile ARGS1(char *, name)
fp = fopen (name, "a+", "shr=get");
chmod(name, HIDE_CHMOD);
#else
-#if defined(__DJGPP__) || defined(_WINDOWS)
- _fmode = O_TEXT;
-#endif /* __DJGPP__ or _WINDOWS */
+ SetDefaultMode(O_TEXT);
fp = OpenHiddenFile(name, "a+");
-#if defined(__DJGPP__) || defined(_WINDOWS)
- _fmode = O_BINARY;
-#endif /* __DJGPP__ or _WINDOWS */
+ SetDefaultMode(O_BINARY);
#endif
return fp;
}
diff --git a/src/LYrcFile.c b/src/LYrcFile.c
index c3968a31..8c4faa3f 100644
--- a/src/LYrcFile.c
+++ b/src/LYrcFile.c
@@ -855,10 +855,10 @@ PUBLIC int save_rc NOPARAMS
* Partial display threshold
*/
fprintf(fp, "\
-# partial_thres specifies the number of lines Lynx should download and render
-# before we redraw the screen in Partial Display logic
-# e.g. partial_thres=2
-# would have Lynx redraw every 2 lines that it renders
+# partial_thres specifies the number of lines Lynx should download and render\n\
+# before we redraw the screen in Partial Display logic\n\
+# e.g. partial_thres=2\n\
+# would have Lynx redraw every 2 lines that it renders\n\
# partial_thres=-1 would use the entire screensize\n");
fprintf(fp, "partial_thres=%d\n\n", partial_threshold);
#endif /* DISP_PARTIAL */
diff --git a/userdefs.h b/userdefs.h
index e4e24783..65afd4ba 100644
--- a/userdefs.h
+++ b/userdefs.h
@@ -1216,12 +1216,12 @@
* the version definition with the Project Version on checkout. Just
* ignore it. - kw */
/* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
-#define LYNX_VERSION "2.8.1pre.5"
+#define LYNX_VERSION "2.8.1pre.6"
#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 "Wed, 30 Sep 1998 15:06:48 -0600"
+#define LYNX_DATE "Thu, 01 Oct 1998 07:15:55 -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"