[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev DIRED for DOS [patch]
From: |
Doug Kaufman |
Subject: |
lynx-dev DIRED for DOS [patch] |
Date: |
Sun, 20 Jun 1999 16:23:56 -0700 (PDT) |
I tested 2.8.3dev.2 on DOS with DJGPP. The integration of the DOS
dired patch had a few problems. The changes to the LYonedot function
cause a failure when the directory name has an extension (i.e.
when trying to zip directory "test.dir" the name for the zip file,
"test_dir.zip" is fine, but it tries to zip the directory "test_dir"
which doesn't exist). The changes to LYDownload.c (which were
submitted as a separate patch) didn't get integrated, so manipulating
a local file via download isn't working in DOS. The changes in
LYLocal.c to remove "the_command" and replace it with "tmpbuf" make
an alert showing the command line appear on the screen with each file
manipulation. I put "the_command" back as a fix for this. "lstat"
is now defined in tcp.h, so the definition in HTFile.c causes a
redefinition error on compiling.
I made a change in the test for stat() failure, since DJGPP's stat
can fail with any non-zero result. Also included is a minor spelling
correction for lynx.cfg.
I think that the following patch fixes the above, but as always check
these carefully.
Doug
--- lynx2-8-3/WWW/Library/Implementation/HTFile.c Fri Jun 18 14:54:46 1999
+++ lynx2-8-3/WWW/Library/Implementation/HTFile.c.new Sun Jun 20 12:11:58 1999
@@ -26,7 +26,6 @@
#ifdef DOSPATH
#define LONG_LIST /* Define this for long style unix listings (ls -l),
the actual style is configurable from lynx.cfg */
-#define lstat stat
#endif
/* #define NO_PARENT_DIR_REFERENCE */ /* Define this for no parent links */
#endif /* !VMS */
--- lynx2-8-3/src/LYDownload.c Sat May 8 10:46:28 1999
+++ lynx2-8-3/src/LYDownload.c.new Sun Jun 20 13:31:32 1999
@@ -91,7 +91,14 @@
#ifdef DIRED_SUPPORT
/* FIXME: use HTLocalName */
if (!strncmp(file, "file://localhost", 16))
+#ifdef __DJGPP__
+ {
+ file += 17;
+ file = HTDOS_name(file);
+ }
+#else
file += 16;
+#endif /* __DJGPP__ */
else if (!strncmp(file, "file:", 5))
file += 5;
HTUnEscape(file);
--- lynx2-8-3/src/LYLocal.c Fri Jun 18 14:54:46 1999
+++ lynx2-8-3/src/LYLocal.c.new Sun Jun 20 14:26:08 1999
@@ -271,7 +271,11 @@
PRIVATE BOOLEAN ok_stat ARGS2(char *, name, struct stat*, sb)
{
CTRACE(tfp, "testing ok_stat(%s)\n", name);
+#ifdef __DJGPP__
+ if (stat(name, sb) != 0) {
+#else
if (stat(name, sb) < 0) {
+#endif /* __DJGPP__ */
return cannot_stat(name);
}
return TRUE;
@@ -1364,9 +1368,11 @@
char *, line)
{
char *dot;
+ char *line1;
if (pathconf (line, _PC_NAME_MAX) <= 12) {
+ strcpy(line1, line);
for (;;) {
- if ((dot = strrchr(line, '.')) == 0
+ if ((dot = strrchr(line1, '.')) == 0
|| LYLastPathSep(dot) != 0) {
break;
} else if (strlen(dot) == 1) {
@@ -1375,8 +1381,9 @@
*dot = '_';
}
}
+ return(line1);
}
- return(line);
+ else return(line);
}
#else
#define LYonedot(path) path
@@ -1619,7 +1626,7 @@
}
_statusline(tmpbuf);
stop_curses();
- printf("%s\n", tmpbuf);
+ printf("%s\r\n", tmpbuf);
LYSystem(buffer);
#ifdef VMS
HadVMSInterrupt = FALSE;
@@ -2099,12 +2106,13 @@
int n;
char *tmpbuf = 0;
#ifdef __DJGPP__
+ char *the_command = 0;
stop_curses();
- HTSprintf(&tmpbuf, "%s", path);
+ HTSprintf(&the_command, "%s", path);
for (n = 1; argv[n] != 0; n++)
- HTSprintf(&tmpbuf, " %s", argv[n]);
- HTSprintf(&tmpbuf, "\n");
- rc = LYSystem(tmpbuf) ? 0 : 1;
+ HTSprintf(&the_command, " %s", argv[n]);
+ HTSprintf(&the_command, "\n");
+ rc = LYSystem(the_command) ? 0 : 1;
#else
pid_t pid;
#ifdef HAVE_TYPE_UNIONWAIT
--- lynx2-8-3/lynx.cfg Fri Jun 18 14:54:46 1999
+++ lynx2-8-3/lynx.cfg.new Sun Jun 20 11:27:42 1999
@@ -619,7 +619,7 @@
#SEEK_FRAG_AREA_IN_CUR:TRUE
# Local execution links and scripts are by default completely disabled,
-# unless a change is made to the userdefs.h file to enabled them or
+# unless a change is made to the userdefs.h file to enable them or
# the configure script is used with the corresponding options
# (--enable-exec-links and --enable-exec-scripts).
# See the Lynx source code distribution and the userdefs.h
__
Doug Kaufman
Internet: address@hidden (preferred)
address@hidden