[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev DOS patch for lynx2.8.5dev.5
From: |
Doug Kaufman |
Subject: |
lynx-dev DOS patch for lynx2.8.5dev.5 |
Date: |
Tue, 25 Dec 2001 09:08:51 -0800 (PST) |
The following patch should fix some longstanding problems with the
DOS port. The biggest complaint to date has been the inability to
break out of a hung nameserver lookup or hung connection attempt
without aborting lynx entirely. This code, using the WATT-32 signal
handler for this seems to work well in the testing done by me and a
few beta testers. This changes the default compile option for DJGPP
to -DIGNORE_CTRL_C. This actually causes lynx to ignore SIGINT, so
CTRL-BREAK is completely disabled. After this patch CTRL-C will stop
current actions without quitting lynx. In order to have a way to
abort lynx when necessary, I bound ALT-X to SIGQUIT. Initially, I had
planned to use the unix default of CTRL-\, but this key is not bound
to the same scan code on different international keyboards, so I used
ALT-X instead, a key combination familiar to DOS users for exiting
programs. The WATT-32 signal handler was not available to external
programs, so a patch to WATT-32 is necessary for the new lynx code to
work. I put the patch for WATT-32 in the INSTALLATION documentation.
I added some fixes for "/" vs "\" handling in pathnames so that
non-DJGPP programs will see standard DOS pathnames when called. The
mailer code was ignoring the environment variable SHELL when calling
the mailer, leading to a lack of environment space for the mailer to
work. This should now be fixed.
Gisle Vanem had mentioned to me that the _eth_release() and
_eth_init() code should not be necessary in this part of lynx, but I
get intermittent hung nameserver lookup sessions after using CTRL-C if
I leave that out.
Doug
--- lynx2.8.5dev.5/lynx2-8-5/src/LYClean.c.ori Mon Feb 26 18:41:56 2001
+++ lynx2.8.5dev.5/lynx2-8-5/src/LYClean.c Sun Nov 18 12:34:16 2001
@@ -13,6 +13,10 @@
#include <LYexit.h>
#include <LYLeaks.h>
+#ifdef WATT32
+extern void sig_handler_watt(int);
+#endif /* WATT32 */
+
#ifdef VMS
BOOLEAN HadVMSInterrupt = FALSE;
#endif /* VMS */
@@ -29,8 +33,17 @@
/*
* Need to rearm the signal.
*/
+#ifdef WATT32
+ if (wathndlcbrk) {
+ sig_handler_watt(sig); /* Use WATT-32 signal handler */
+ } /* Requires patch to WATT-32 */
+#endif /* WATT32 */
signal(SIGINT, cleanup_sig);
sigint = TRUE;
+#ifdef WATT32
+ _eth_release();
+ _eth_init();
+#endif /* WATT32 */
return;
}
#endif /* IGNORE_CTRL_C */
--- lynx2.8.5dev.5/src/LYCurses.c.ori Sun Nov 18 17:37:14 2001
+++ lynx2.8.5dev.5/srcLYCurses.c Mon Dec 24 21:01:52 2001
@@ -2,6 +2,10 @@
#include <HTAlert.h>
#ifdef __DJGPP__
#include <conio.h>
+#ifndef HAVE_GETTEXT
+#undef gettext
+#define gettext(s) s
+#endif /* HAVE_GETTEXT */
#endif /* __DJGPP__ */
#include <LYCurses.h>
#include <LYStyle.h>
--- lynx2.8.5dev.5/lynx2-8-5/src/LYMain.c.ori Sun Nov 18 17:37:14 2001
+++ lynx2.8.5dev.5/lynx2-8-5/src/LYMain.c Sun Dec 16 19:47:46 2001
@@ -40,6 +40,7 @@
#include <dpmi.h>
#include <io.h>
#include <sys/stat.h>
+#include <sys/exceptn.h>
#endif /* __DJGPP__ */
#ifdef __EMX__
@@ -948,6 +949,8 @@
} else {
init_ctrl_break[0] = 1;
}
+ __djgpp_set_sigquit_key(0x082D); /* Bind ALT-X to SIGQUIT */
+ signal(SIGQUIT, cleanup_sig);
atexit(reset_break);
#endif /* __DJGPP__ */
@@ -1101,15 +1104,15 @@
if ((cp = getenv("LYNX_TEMP_SPACE")) != NULL)
StrAllocCopy(lynx_temp_space, cp);
-#if defined (UNIX)
+#if defined (UNIX) || defined (__DJGPP__)
else if ((cp = getenv("TMPDIR")) != NULL)
StrAllocCopy(lynx_temp_space, cp);
#endif
#if defined (DOSPATH) || defined (__EMX__)
else if ((cp = getenv("TEMP")) != NULL)
- StrAllocCopy(lynx_temp_space, HTSYS_name(cp));
+ StrAllocCopy(lynx_temp_space, cp);
else if ((cp = getenv("TMP")) != NULL)
- StrAllocCopy(lynx_temp_space, HTSYS_name(cp));
+ StrAllocCopy(lynx_temp_space, cp);
#endif
else
#ifdef TEMP_SPACE
@@ -1159,6 +1162,7 @@
}
#else
LYAddPathSep(&lynx_temp_space);
+ StrAllocCopy(lynx_temp_space, HTSYS_name(lynx_temp_space));
#endif /* VMS */
if ((HTStat(lynx_temp_space, &dir_info) < 0
--- lynx2.8.5dev.5/lynx2-8-5/src/LYMail.c.ori Sun Jun 3 11:58:00 2001
+++ lynx2.8.5dev.5/lynx2-8-5/src/LYMail.c Mon Nov 26 22:45:46 2001
@@ -476,6 +476,9 @@
char *, message)
{
char *cmd = NULL;
+#ifdef __DJGPP__
+ char *shell;
+#endif /* __DJGPP__ */
int code;
#if USE_BLAT_MAILER
@@ -492,10 +495,33 @@
);
else
#endif
+#ifdef __DJGPP__
+ if ((shell = getenv("SHELL")) != NULL) {
+ if (strstr(shell, "sh") != NULL) {
+ HTSprintf0(&cmd, "%s -c %s -t \"%s\" -F %s",
+ shell,
+ system_mail,
+ the_address,
+ the_filename);
+ } else {
+ HTSprintf0(&cmd, "%s /c %s -t \"%s\" -F %s",
+ shell,
+ system_mail,
+ the_address,
+ the_filename);
+ }
+ } else {
+ HTSprintf0(&cmd, "%s -t \"%s\" -F %s",
+ system_mail,
+ the_address,
+ the_filename);
+ }
+#else
HTSprintf0(&cmd, "%s -t \"%s\" -F %s",
system_mail,
the_address,
the_filename);
+#endif /* __DJGPP__ */
stop_curses();
SetOutputMode(O_TEXT);
--- lynx2.8.5dev.5/lynx2-8-5/INSTALLATION.ori Thu Nov 8 12:48:34 2001
+++ lynx2.8.5dev.5/lynx2-8-5/INSTALLATION Wed Dec 19 23:22:12 2001
@@ -848,6 +848,25 @@
can be obtained from the openssl-dev archives at:
"http://www.mail-archive.com/address@hidden/msg09104/096b.pch.gz"
+ In order for lynx to be able to break out of a stuck nameserver
+ lookup or connection attempt, you should compile with -DIGNORE_CTRL_C
+ and apply the following patch to WATT-32.
+
+ --- watt32-2.1dev.rel.5/src/pc_cbrk.c.ori Mon Jun 19 16:08:06 2000
+ +++ watt32-2.1dev.rel.5/src/pc_cbrk.c Sun Nov 18 11:18:50 2001
+ @@ -74,6 +74,11 @@
+ longjmp (sig_jmp, 1);
+ }
+
+ +void sig_handler_watt (int sig)
+ +{
+ + sig_handler (int sig);
+ +}
+ +
+ /*
+ * want_brk = 0: no ^Break checking
+ * want_brk = 1: normal ^Break checks
+
If you have trouble applying the patches, try using the "patch" program,
("ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/pat253b.zip").
To read the Unix man style documentation, use, for example, "less"
@@ -951,7 +970,7 @@
instead of the SLANG keyhandler unless you define "NO_DJ_KEYHANDLER".
#!/bin/sh
- CFLAGS="-O2 -I/djgpp/pdcur24 -I/djgpp/watt32/inc" \
+ CFLAGS="-O2 -DIGNORE_CTRL_C -I/djgpp/pdcur24 -I/djgpp/watt32/inc" \
LIBS="-L/djgpp/pdcur24/lib -L/djgpp/watt32/lib -liconv" \
./configure --prefix=d:/djgpp/lynx-rel/lynx-cnf \
--with-screen=curses \
@@ -975,7 +994,7 @@
-- 1997/9/29 - D. Kaufman <address@hidden>
-- 1997/10/3 - B. Schiavo <address@hidden>
--- Last update - 2001/08/01
+-- Last update - 2001/12/19
VI. General installation instructions
__
Doug Kaufman
Internet: address@hidden
; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden
- lynx-dev DOS patch for lynx2.8.5dev.5,
Doug Kaufman <=