[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev (patch) dev21: avoid expanding ~ to $HOME for DOS/WIN
From: |
Leonid Pauzner |
Subject: |
lynx-dev (patch) dev21: avoid expanding ~ to $HOME for DOS/WIN |
Date: |
Wed, 31 Mar 1999 16:47:28 +0400 (MSD) |
* fix to avoid expanding ~ to $HOME for non UNIX/VMS filesystems
where this character is a valid char within filename (one particular problem
was for Win95 LFN path being in TEMP, report by
"Robert D. Dedman" <address@hidden>). More places fixed,
currently ifdef'ed with DOSPATH, but how about __EMX__? - LP
How about checking for "~/" flashed left
instead of if ((cp = strchr(lynx_temp_space, '~'))) ...?
********************************************************
In particular, TEMP=c:\add\t~mp
gives the folowing nice report when pressing 'd'ownload:
StreamStack: Using www/download
LYOpenTemp(,.txt,wb)
-> 'c:\add\tc:/lynx/dist28/currentmp\212837.txt'
... LYOpenTemp(c:\add\tc:/lynx/dist28/currentmp\212837.txt) failed: No such
file or directory (ENOENT)
Alert!: Can't open output file! Cancelling!
HTFormat(in HTParseFile): Sorry, no known way of converting text/plain to
www/download.
Alert!: Sorry, no known way of converting text/plain to www/download.
HTAccess: status=-501
Can't Access `file://localhost/c:/lynx/changes/wwco'
HTAccess: Can't access `file://localhost/c:/lynx/changes/wwco'
Alert!: Unable to access document.
***************************************************
diff -u old/lygetfil.c ./lygetfil.c
--- old/lygetfil.c Wed Mar 31 00:43:06 1999
+++ ./lygetfil.c Wed Mar 31 15:48:14 1999
@@ -395,6 +395,7 @@
doc->address[strlen(doc->address)-1] = '\0';
p = doc->address;
+#if !defined(DOSPATH)
/*
* Convert '~' to $HOME.
*/
@@ -406,6 +407,7 @@
strcat(addressbuf, cp+1);
p = addressbuf;
}
+#endif
/*
* Show URL before executing it.
*/
diff -u old/lymain.c ./lymain.c
--- old/lymain.c Wed Mar 31 00:43:08 1999
+++ ./lymain.c Wed Mar 31 16:02:38 1999
@@ -829,6 +829,7 @@
}
#endif
+#if !defined(DOSPATH)
if ((cp = strchr(lynx_temp_space, '~'))) {
*(cp++) = '\0';
StrAllocCopy(temp, lynx_temp_space);
@@ -852,6 +853,7 @@
FREE(temp);
}
}
+#endif
#ifdef VMS
LYLowerCase(lynx_temp_space);
if (strchr(lynx_temp_space, '/') != NULL) {
@@ -871,6 +873,7 @@
#else
LYAddPathSep(&lynx_temp_space);
#endif /* VMS */
+
#ifdef VMS
StrAllocCopy(mail_adrs, MAIL_ADRS);
#ifdef CSWING_PATH
@@ -1196,7 +1199,7 @@
/*
* Convert a '~' in the configuration file path to $HOME.
*/
-#ifndef _WINDOWS /* avoid the whole ~ thing for now */
+#ifndef DOSPATH /* avoid the whole ~ thing for now */
/* I think this should only be performed if lynx_cfg_file starts with ~/ */
if ((lynx_cfg_file[0] == '~') && LYIsPathSep(lynx_cfg_file[1]))
{
@@ -1270,6 +1273,7 @@
if (!lynx_lss_file)
StrAllocCopy(lynx_lss_file, LYNX_LSS_FILE);
+#if !defined(DOSPATH)
/*
* Convert a '~' in the lynx-style file path to $HOME.
*/
@@ -1286,6 +1290,7 @@
StrAllocCopy(lynx_lss_file, temp);
FREE(temp);
}
+#endif
/*
* If the lynx-style file is not available,
* inform the user and exit.
@@ -1398,6 +1403,7 @@
if (persistent_cookies) {
if(LYCookieFile == NULL) {
LYAddPathToHome(LYCookieFile = malloc(LY_MAXPATH), LY_MAXPATH,
COOKIE_FILE);
+#if !defined(DOSPATH)
} else {
if ((cp = strchr(LYCookieFile, '~'))) {
temp = NULL;
@@ -1408,6 +1414,7 @@
StrAllocCat(LYCookieFile, temp);
FREE(temp);
}
+#endif
}
LYLoadCookies(LYCookieFile);
}
@@ -1428,6 +1435,7 @@
FREE(lynx_save_space);
}
if (lynx_save_space) {
+#if !defined(DOSPATH)
if ((cp = strchr(lynx_save_space, '~')) != NULL) {
*(cp++) = '\0';
StrAllocCopy(temp, lynx_save_space);
@@ -1437,6 +1445,7 @@
StrAllocCopy(lynx_save_space, temp);
FREE(temp);
}
+#endif
#ifdef VMS
LYLowerCase(lynx_save_space);
if (strchr(lynx_save_space, '/') != NULL) {
Only in .: lynx.tra
diff -u old/lyutils.c ./lyutils.c
--- old/lyutils.c Wed Mar 31 00:43:14 1999
+++ ./lyutils.c Wed Mar 31 15:30:24 1999
@@ -6044,6 +6044,7 @@
return TRUE;
}
#endif
+#if !defined(DOSPATH)
if ((cp = strchr(given, '~'))) {
*(cp++) = '\0';
strcpy(result, given);
@@ -6052,6 +6053,7 @@
strcat(result, cp);
strcpy(given, result);
}
+#endif
#ifdef VMS
if (strchr(given, '/') != NULL) {
strcpy(result, HTVMS_name("", given));
- lynx-dev (patch) dev21: avoid expanding ~ to $HOME for DOS/WIN,
Leonid Pauzner <=