diff options
-rw-r--r-- | CHANGES | 16 | ||||
-rw-r--r-- | src/HTAlert.c | 6 | ||||
-rw-r--r-- | src/LYClean.c | 12 | ||||
-rw-r--r-- | src/LYCurses.c | 3 | ||||
-rw-r--r-- | src/LYMain.c | 30 | ||||
-rw-r--r-- | src/LYStrings.c | 13 | ||||
-rw-r--r-- | src/LYStrings.h | 2 | ||||
-rw-r--r-- | src/LYUtils.c | 3 | ||||
-rw-r--r-- | userdefs.h | 4 |
9 files changed, 70 insertions, 19 deletions
diff --git a/CHANGES b/CHANGES index 285fe85f..723e2a54 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,16 @@ Changes since Lynx 2.8 release =============================================================================== +2000-11-03 (2.8.4dev.14) +* restore initialization of LYlines, LYcols in setup() which was lost in dev.12 + changes (reported by DK). +* modify logic for -stdin option to redirect keyboard input to null device + if lynx is not connected to a terminal, e.g., running under cron -TD +* check in DontCheck() if Lynx is reading from a command-script, to avoid + using those characters to interrupt the application -TD +* add a cleanup handler for win32, since UNIX-style signal handlers do not + work on that platform -TD + 2000-10-25 (2.8.4dev.13) * fix missing ifdef for EXP_READPROGRESS in LYOptions.c (reported by Atsuhito Kohda) -TD @@ -48,7 +58,7 @@ Changes since Lynx 2.8 release input.type.:normal:white:cyan input.type.text:normal:white:cyan If your "link" is configured as normal:green, then input elements of types - other than typeless, text, or submit will be shown in the same style as link. + other than typeless, text, or submit will be shown in the same style as link. The textareas and text input elements are shown in the same style (but different from "link" style), and submit "buttons" are shown yet in another style. @@ -57,7 +67,7 @@ Changes since Lynx 2.8 release This patch is concerned with the first flavor only. Two subflavors are document's text-edit areas, and Lynx's ones (such as where you input the URL after `g'). Each one of them has 3 elements: scroll symbols ("arrows"), - after-the-end padding, and the actual input string. + after-the-end padding, and the actual input string. The patch a) makes styles for these 2*3 elements customizable; b) uses ACS chars (if available) for the arrows (instead of `{'/`}'). @@ -104,7 +114,7 @@ Changes since Lynx 2.8 release * add fallback definitions to accommodate renaming of UCX$xxx symbols to TCPIP$xxx in recent versions of OpenVMS UCX (reported by Horst Drechsel <ai05@sternwarte.uni-erlangen.de>) -TD -* add TRSTable.obj to src/descrip.mms objects -TD +* add TRSTable.obj to src/descrip.mms objects -TD * modify configure script to omit LYExtern.o and LYLocal.o if the corresponding options (externs and dired) are disabled -TD * correct a typo that made configure script always define USE_EXTERNALS -TD diff --git a/src/HTAlert.c b/src/HTAlert.c index 28ea7867..132a34a7 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -180,7 +180,7 @@ PUBLIC void HTReadProgress ARGS2( static double first, last, last_active; #else #if defined(HAVE_FTIME) && defined(HAVE_SYS_TIMEB_H) - static double now, first, last; + static double now, first, last, last_active; struct timeb tb; ftime(&tb); @@ -202,7 +202,7 @@ PUBLIC void HTReadProgress ARGS2( (now != first)) /* 1 sec delay for transfer_rate calculation without g-t-o-d */ { if (transfer_rate <= 0) /* the very first time */ - transfer_rate = (bytes) / (now - first); /* bytes/sec */ + transfer_rate = (long)((bytes) / (now - first)); /* bytes/sec */ total_last = total; /* @@ -225,7 +225,7 @@ PUBLIC void HTReadProgress ARGS2( if (bytes_last != bytes) last_active = now; bytes_last = bytes; - transfer_rate = bytes / (now - first); /* more accurate here */ + transfer_rate = (long)(bytes / (now - first)); /* more accurate here */ } if (total > 0) diff --git a/src/LYClean.c b/src/LYClean.c index 216b1618..89270923 100644 --- a/src/LYClean.c +++ b/src/LYClean.c @@ -26,12 +26,12 @@ PUBLIC void cleanup_sig ARGS1( #ifdef IGNORE_CTRL_C if (sig == SIGINT) { - /* - * Need to rearm the signal. - */ - signal(SIGINT, cleanup_sig); - sigint = TRUE; - return; + /* + * Need to rearm the signal. + */ + signal(SIGINT, cleanup_sig); + sigint = TRUE; + return; } #endif /* IGNORE_CTRL_C */ diff --git a/src/LYCurses.c b/src/LYCurses.c index de225c6f..7cddbc34 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -1258,6 +1258,9 @@ PUBLIC BOOLEAN setup ARGS1( } #endif /* HAVE_TTYTYPE */ + LYlines = LINES; + LYcols = COLS; + #if defined(PDCURSES_EXP) && defined(WIN_EX) && defined(CJK_EX) /* 1999/08/26 (Thu) 17:53:38 */ { extern int current_codepage; /* PDCurses lib. */ diff --git a/src/LYMain.c b/src/LYMain.c index a06c4bf3..11b2b916 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -810,6 +810,19 @@ PRIVATE BOOL GetStdin ARGS1( return FALSE; } +#ifdef WIN32 +PRIVATE BOOL cleanup_win32(DWORD fdwCtrlType) +{ + switch (fdwCtrlType) { + case CTRL_CLOSE_EVENT: + cleanup_sig(-1); + return TRUE; + default: + return FALSE; + } +} +#endif + /* * Wow! Someone wants to start up Lynx. */ @@ -1450,17 +1463,21 @@ PUBLIC int main ARGS2( } #undef TTY_DEVICE +#undef NUL_DEVICE #ifdef VMS #define TTY_DEVICE "tt:" +#define NUL_DEVICE "nl:" #endif #ifdef _WINDOWS #define TTY_DEVICE "con" +#define NUL_DEVICE "nul" #endif #ifndef TTY_DEVICE #define TTY_DEVICE "/dev/tty" +#define NUL_DEVICE "/dev/null" #endif #if defined (TTY_DEVICE) || defined(HAVE_TTYNAME) @@ -1476,9 +1493,9 @@ PUBLIC int main ARGS2( tty = ttyname(fileno(stderr)); # endif if (tty == NULL) - tty = TTY_DEVICE; + tty = isatty(fileno(stdin)) ? TTY_DEVICE : NUL_DEVICE; - CTRACE((tfp, "processing stdin startfile\n")); + CTRACE((tfp, "processing stdin startfile, tty=%s\n", tty)); if ((fp = LYOpenTemp (result, HTML_SUFFIX, "w")) != 0) { StrAllocCopy(startfile, result); while (GetStdin(&buf)) { @@ -1489,8 +1506,7 @@ PUBLIC int main ARGS2( LYCloseTempFP(fp); } CTRACE((tfp, "...done stdin startfile\n")); - if ((freopen(tty, "r", stdin)) == 0 - || !isatty(fileno(stdin))) { + if ((freopen(tty, "r", stdin)) == 0) { CTRACE((tfp, "cannot open a terminal (%s)\n", tty)); if (!dump_output_immediately) { fprintf(stderr, "cannot open a terminal (%s)\n", tty); @@ -1740,13 +1756,17 @@ PUBLIC int main ARGS2( #endif /* __DJGPP__ */ /* trap interrupts */ +#ifdef WIN32 + SetConsoleCtrlHandler((PHANDLER_ROUTINE) cleanup_win32, TRUE); +#endif if (!dump_output_immediately) #ifndef NOSIGHUP (void) signal(SIGHUP, cleanup_sig); #endif /* NOSIGHUP */ + (void) signal(SIGTERM, cleanup_sig); #ifdef SIGWINCH - LYExtSignal(SIGWINCH, size_change); + LYExtSignal(SIGWINCH, size_change); #endif /* SIGWINCH */ #ifndef VMS if (!TRACE && !dump_output_immediately && !stack_dump) { diff --git a/src/LYStrings.c b/src/LYStrings.c index 51625738..b6e1e387 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -4483,6 +4483,7 @@ PUBLIC int LYgetstr ARGS4( LYSetupEdit(&MyEdit, inputline, MaxStringSize, (LYcols-1)-x); MyEdit.hidden = hidden ; + CTRACE((tfp, "called LYgetstr\n")); for (;;) { again: #ifndef SUPPORT_MULTIBYTE_EDIT @@ -4522,6 +4523,7 @@ again: if (recall != NORECALL && (ch == UPARROW || ch == DNARROW)) { LYstrncpy(inputline, MyEdit.buffer, (int)bufsize); LYAddToCloset(MyEdit.buffer); + CTRACE((tfp, "LYgetstr(%s) recall\n", inputline)); return(ch); } ch |= CurModif; @@ -4626,6 +4628,7 @@ again: LYstrncpy(inputline, MyEdit.buffer, (int)bufsize); if (!hidden) LYAddToCloset(MyEdit.buffer); + CTRACE((tfp, "LYgetstr(%s) LYE_ENTER\n", inputline)); return(ch); #if defined(WIN_EX) @@ -4659,6 +4662,7 @@ again: * Control-C or Control-G aborts. */ inputline[0] = '\0'; + CTRACE((tfp, "LYgetstr LYE_ABORT\n")); return(-1); case LYE_LKCMD: @@ -5533,10 +5537,18 @@ PUBLIC void LYOpenCmdLogfile ARGS2( } } +PUBLIC BOOL LYHaveCmdScript NOARGS +{ + return cmd_script != 0; +} + PUBLIC void LYOpenCmdScript NOARGS { if (lynx_cmd_script != 0) { cmd_script = fopen(lynx_cmd_script, "r"); + CTRACE((tfp, "LYOpenCmdScript(%s) %s\n", + lynx_cmd_script, + cmd_script != 0 ? "SUCCESS" : "FAIL")); } } @@ -5567,6 +5579,7 @@ PUBLIC int LYReadCmdKey ARGS1( } else { ch = LYgetch_for(mode); } + CTRACE((tfp, "LYReadCmdKey(%d) ->%c (%#x)\n", mode, ch, ch)); LYWriteCmdKey(ch); return ch; } diff --git a/src/LYStrings.h b/src/LYStrings.h index 5df1d16d..82066819 100644 --- a/src/LYStrings.h +++ b/src/LYStrings.h @@ -94,12 +94,14 @@ extern char * SNACat PARAMS(( extern char *LYSafeGets PARAMS((char ** src, FILE * fp)); #ifdef EXP_CMD_LOGGING +extern BOOL LYHaveCmdScript NOPARAMS; extern int LYReadCmdKey PARAMS((int mode)); extern void LYCloseCmdLogfile NOPARAMS; extern void LYOpenCmdLogfile PARAMS((int argc, char **argv)); extern void LYOpenCmdScript NOPARAMS; extern void LYWriteCmdKey PARAMS((int ch)); #else +#define LYHaveCmdScript() FALSE #define LYReadCmdKey(mode) LYgetch_for(mode) #define LYCloseCmdLogfile() /* nothing */ #endif diff --git a/src/LYUtils.c b/src/LYUtils.c index 02cfcce3..1cd2a119 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -2246,6 +2246,9 @@ PRIVATE int DontCheck NOARGS if (dump_output_immediately) return(TRUE); + if (LYHaveCmdScript()) /* we may be running from a script */ + return(TRUE); + #ifdef MISC_EXP if (LYNoZapKey) return(TRUE); diff --git a/userdefs.h b/userdefs.h index 2451ad17..75a45b7a 100644 --- a/userdefs.h +++ b/userdefs.h @@ -1345,11 +1345,11 @@ * the version definition with the Project Version on checkout. Just * ignore it. - kw */ /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */ -#define LYNX_VERSION "2.8.4dev.13" +#define LYNX_VERSION "2.8.4dev.14" #define LYNX_WWW_HOME "http://lynx.browser.org/" #define LYNX_WWW_DIST "http://lynx.isc.org/current/" /* $Format: "#define LYNX_DATE \"$ProjectDate$\""$ */ -#define LYNX_DATE "Wed, 25 Oct 2000 18:59:25 -0700" +#define LYNX_DATE "Fri, 03 Nov 2000 01:44:11 -0800" #define LYNX_DATE_OFF 5 /* truncate the automatically-generated date */ #define LYNX_DATE_LEN 11 /* truncate the automatically-generated date */ |