rc

[fork] interactive rc shell
Log | Files | Refs | README | LICENSE

commit 43ce7b24fad3fc46860648d00544176526dcafcc
parent e9fc7b5a7c12eeb3bffbb170d7ff8a6649f93980
Author: tjg <tjg>
Date:   Mon, 11 Oct 1999 11:16:46 +0000

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:
MChangeLog | 5+++++
Mglob.c | 8++------
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git 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 @@ -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.