You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@locus.apache.org on 2000/09/22 20:33:20 UTC
cvs commit: apache-1.3/src/main util.c
wrowe 00/09/22 11:33:18
Modified: src/main util.c
Log:
Modify ap_make_dirstr_prefix, platforms with HAVE_DRIVE_LETTERS or NETWARE
can request 0 elements, returning the '/' root.
[William Rowe, Tim Costello]
Revision Changes Path
1.187 +13 -1 apache-1.3/src/main/util.c
Index: util.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/util.c,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -r1.186 -r1.187
--- util.c 2000/07/30 01:24:03 1.186
+++ util.c 2000/09/22 18:33:17 1.187
@@ -505,7 +505,7 @@
s = d = name;
-#ifdef WIN32
+#ifdef HAVE_UNC_PATHS
/* Check for UNC names. Leave leading two slashes. */
if (s[0] == '/' && s[1] == '/')
*d++ = *s++;
@@ -536,9 +536,21 @@
* /a/b, 2 ==> /a/
* /a/b, 3 ==> /a/b/
* /a/b, 4 ==> /a/b/
+ *
+ * MODIFIED FOR HAVE_DRIVE_LETTERS and NETWARE environments,
+ * so that if n == 0, "/" is returned in d with n == 1
+ * and s == "e:/test.html", "e:/" is returned in d
+ * *** See also directory_walk in src/main/http_request.c
*/
API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n)
{
+#if defined(HAVE_DRIVE_LETTERS) || defined(NETWARE)
+ if (!n) {
+ *d = '/';
+ *++d = '\0';
+ return (d);
+ }
+#endif /* def HAVE_DRIVE_LETTERS || NETWARE */
for (;;) {
*d = *s;
if (*d == '\0') {