summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--glob.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c3be16e..360c14e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -607,3 +607,8 @@ Changes since rc-1.5b2
Portability: the proposed C 9x __va_copy() macro is called that, not
va_copy(), as I thought. Furthermore, it is defined to be a macro, so
we don't need to use autoconf to check for it.
+
+1999-10-11
+
+ Bug: absolute globs don't need special case in doglob(). Avoids
+ creating path names like `//tmp', which is a UNC path under CygWin.
diff --git a/glob.c b/glob.c
index 419a096..03d8a42 100644
--- a/glob.c
+++ b/glob.c
@@ -216,12 +216,8 @@ static List *doglob(char *w, char *m) {
p = pattern;
md = metadir;
mp = metapattern;
- if (*s == '/')
- while (*s == '/')
- *d++ = *s++, *md++ = *m++;
- else
- while (*s != '/' && *s != '\0')
- *d++ = *s++, *md++ = *m++; /* get first directory component */
+ while (*s != '/' && *s != '\0')
+ *d++ = *s++, *md++ = *m++; /* get first directory component */
*d = '\0';
/*
Special case: no slashes in the pattern, i.e., open the current directory.