[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev Revised (again) DOS patch
From: |
Doug Kaufman |
Subject: |
lynx-dev Revised (again) DOS patch |
Date: |
Fri, 4 Sep 1998 08:29:15 -0700 (PDT) |
I hope this will be the last revision of this patch. I noted that the
patch didn't work if PWD was defined with '\' rather than '/' path
separators. That is now fixed. I noted similar problems with LYPrint.c,
so parallel changes have been made there. Lastly, I changed the ifdef
to include _WINDOWS, since the same problems should occur if PWD is
defined in the environment. I don't have the machine to test this on
Win32, however.
Doug
*** lynx2-8-1/src/LYDownload.c Sat Aug 29 16:22:40 1998
--- lynx2-8-1/src/LYDownload.c.new Fri Sep 4 08:01:34 1998
***************
*** 264,274 ****
}
#else
#ifndef __EMX__
! if (*buffer != '/')
cp = getenv("PWD");
else
#endif /* __EMX__*/
cp = NULL;
if (cp) {
sprintf(command, "%s/%s", cp, buffer);
#ifdef DOSPATH
--- 264,284 ----
}
#else
#ifndef __EMX__
! if (*buffer != '/'){
! #if defined(__DJGPP__) || defined(_WINDOWS)
! if (strchr(buffer, ':') != NULL)
! cp = NULL;
! else
! #endif /* __DJGPP__ || _WINDOWS */
cp = getenv("PWD");
+ }
else
#endif /* __EMX__*/
cp = NULL;
+ #if defined(__DJGPP__) || defined(_WINDOWS)
+ if (cp != NULL &&(len = strlen(cp)) > 0 && (cp[len-1] == '/' ||
cp[len-1] == '\\'))
+ cp[len-1] = '\0';
+ #endif /* __DJGPP__ || _WINDOWS */
if (cp) {
sprintf(command, "%s/%s", cp, buffer);
#ifdef DOSPATH
*** lynx2-8-1/src/LYPrint.c Sat Aug 29 16:22:40 1998
--- lynx2-8-1/src/LYPrint.c.new Fri Sep 4 08:02:28 1998
***************
*** 401,411 ****
}
#else
#ifndef __EMX__
! if (*filename != '/')
cp = getenv("PWD");
else
#endif
cp = NULL;
if (cp)
#ifdef DOSPATH
sprintf(buffer, "%s/%s", cp, HTDOS_name(filename));
--- 401,421 ----
}
#else
#ifndef __EMX__
! if (*filename != '/'){
! #if defined(__DJGPP__) || defined(_WINDOWS)
! if (strchr(buffer, ':') != NULL)
! cp = NULL;
! else
! #endif /* __DJGPP__ || _WINDOWS */
cp = getenv("PWD");
+ }
else
#endif
cp = NULL;
+ #if defined(__DJGPP__) || defined(_WINDOWS)
+ if (cp != NULL &&(len = strlen(cp)) > 0 && (cp[len-1] == '/' ||
cp[len-1] == '\\'))
+ cp[len-1] = '\0';
+ #endif /* __DJGPP__ || _WINDOWS */
if (cp)
#ifdef DOSPATH
sprintf(buffer, "%s/%s", cp, HTDOS_name(filename));
__
Doug Kaufman
Internet: address@hidden (preferred)
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lynx-dev Revised (again) DOS patch,
Doug Kaufman <=