summaryrefslogtreecommitdiff
path: root/glob.c
diff options
context:
space:
mode:
authortjg <tjg>1999-10-11 11:16:46 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:16 +0100
commit43ce7b24fad3fc46860648d00544176526dcafcc (patch)
treea7a089735da949f91da75931a2075dca37bda413 /glob.c
parente9fc7b5a7c12eeb3bffbb170d7ff8a6649f93980 (diff)
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.
Diffstat (limited to 'glob.c')
-rw-r--r--glob.c8
1 files changed, 2 insertions, 6 deletions
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.