ben 98/03/03 13:16:50
Modified: src CHANGES
src/os/win32 util_win32.c
Log:
Move (and document) the trailing / fix.
Revision Changes Path
1.679 +3 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.678
retrieving revision 1.679
diff -u -r1.678 -r1.679
--- CHANGES 1998/03/03 01:22:03 1.678
+++ CHANGES 1998/03/03 21:16:47 1.679
@@ -1,5 +1,8 @@
Changes with Apache 1.3b6
+ *) WIN32: Preserve trailing slash in canonical path (and hence
+ in PATH_INFO). [Paul Sutton, Ben Laurie]
+
*) USE_PTHREAD_SERIALIZED_ACCEPT has proven unreliable depending on
the rev of Solaris and what mixture of modules are in use. So
it has been disabled, and Solaris is back to using
1.10 +8 -9 apache-1.3/src/os/win32/util_win32.c
Index: util_win32.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/os/win32/util_win32.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- util_win32.c 1998/03/02 10:57:59 1.9
+++ util_win32.c 1998/03/03 21:16:49 1.10
@@ -12,17 +12,11 @@
char *szFilePart;
WIN32_FIND_DATA d;
HANDLE h;
- int add_trailing_slash = 0;
n = GetFullPathName(szFile, sizeof buf, buf, &szFilePart);
assert(n);
assert(n < sizeof buf);
- if (*szFile && szFile[strlen(szFile)-1] == '/') {
- add_trailing_slash = 1;
- }
-
-
if (!strchr(buf, '*') && !strchr(buf, '?')) {
h = FindFirstFile(buf, &d);
if(h != INVALID_HANDLE_VALUE)
@@ -58,17 +52,22 @@
strlwr(d.cFileName);
strcat(szCanon, d.cFileName);
}
- if (add_trailing_slash) {
- strcat(szCanon, "/");
- }
}
API_EXPORT(char *) os_canonical_filename(pool *pPool, const char *szFile)
{
char buf[HUGE_STRING_LEN];
+ int add_trailing_slash = 0;
+ if (*szFile && szFile[strlen(szFile)-1] == '/')
+ add_trailing_slash = 1;
+
sub_canonical_filename(buf, szFile);
buf[0]=tolower(buf[0]);
+
+ if (add_trailing_slash)
+ strcat(buf, "/");
+
return pstrdup(pPool, buf);
}