pcs 98/03/02 02:57:59
Modified: src CHANGES src/os/win32 util_win32.c Log: Revert patch which fixed PR#1712 but broken the #! method of specifying an interpreter for a script. PR#1712 will be reopened. Revision Changes Path 1.677 +0 -4 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.676 retrieving revision 1.677 diff -u -r1.676 -r1.677 --- CHANGES 1998/03/02 06:51:01 1.676 +++ CHANGES 1998/03/02 10:57:57 1.677 @@ -216,10 +216,6 @@ when the client doesn't otherwise specify an encoding. [Ronald Tschalaer <[EMAIL PROTECTED]>] - *) WIN32: Append a '.' to extensionless executables in spawn[lv]e* - replacements, which makes them work. - [Sam Robb <[EMAIL PROTECTED]>, Ben Laurie] - *) Sort out problems with canonical filename handling happening too late. [Dean Gaudet, Ben Laurie] 1.9 +13 -26 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.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- util_win32.c 1998/02/08 18:50:51 1.8 +++ util_win32.c 1998/03/02 10:57:59 1.9 @@ -12,11 +12,17 @@ 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) @@ -52,6 +58,9 @@ strlwr(d.cFileName); strcat(szCanon, d.cFileName); } + if (add_trailing_slash) { + strcat(szCanon, "/"); + } } API_EXPORT(char *) os_canonical_filename(pool *pPool, const char *szFile) @@ -85,11 +94,10 @@ return stat(szPath, pStat); } -/* Fix three really crap problems with Win32 spawn[lv]e*: +/* Fix two really crap problems with Win32 spawn[lv]e*: * * 1. Win32 doesn't deal with spaces in argv. * 2. Win95 doesn't like / in cmdname. - * 3. Win32 wants a '.' appended to extensionless files. */ #undef _spawnv @@ -100,20 +108,13 @@ const char *szArg; char *szCmd; char *s; - int len=strlen(cmdname); - szCmd = _alloca(len+2); + szCmd = _alloca(strlen(cmdname)+1); strcpy(szCmd, cmdname); for (s = szCmd; *s; ++s) if (*s == '/') *s = '\\'; - s = strrchr(szCmd, '.'); - if (!s || s < strrchr(szCmd, '\\')) { - szCmd[len] = '.'; - szCmd[len+1] = '\0'; - } - for (n=0; argv[n]; ++n) ; @@ -146,20 +147,13 @@ const char *szArg; char *szCmd; char *s; - int len=strlen(cmdname); - szCmd = _alloca(len+2); + szCmd = _alloca(strlen(cmdname)+1); strcpy(szCmd, cmdname); for (s = szCmd; *s; ++s) if (*s == '/') *s = '\\'; - s = strrchr(szCmd, '.'); - if (!s || s < strrchr(szCmd, '\\')) { - szCmd[len] = '.'; - szCmd[len+1] = '\0'; - } - for (n = 0; argv[n] ; ++n) ; @@ -193,19 +187,12 @@ const char *const *aszEnv; char *szCmd; char *s; - int len=strlen(cmdname); - szCmd = _alloca(len+2); + szCmd = _alloca(strlen(cmdname)+1); strcpy(szCmd, cmdname); for (s = szCmd; *s; ++s) if(*s == '/') *s = '\\'; - - s = strrchr(szCmd, '.'); - if (!s || s < strrchr(szCmd, '\\')) { - szCmd[len] = '.'; - szCmd[len+1] = '\0'; - } va_start(vlist, cmdname); for (n = 0; va_arg(vlist, const char *); ++n)