diff options
author | Rich Felker <dalias@aerifal.cx> | 2017-06-08 19:50:23 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2017-06-08 19:50:23 -0400 |
commit | 84eff797e3e38210cc311b000b1586b948b4fc35 (patch) | |
tree | 93d792eac55fb99cd0453617aaa340d177f90072 /src/regex/glob.c | |
parent | bc313e880c6cde2e512d2f43e84968d1b12bd19d (diff) | |
download | musl-84eff797e3e38210cc311b000b1586b948b4fc35.tar.gz musl-84eff797e3e38210cc311b000b1586b948b4fc35.tar.bz2 musl-84eff797e3e38210cc311b000b1586b948b4fc35.tar.xz musl-84eff797e3e38210cc311b000b1586b948b4fc35.zip |
fix glob failure to match plain "/" to root directory
the check to prevent matching empty string wrongly blocked matching
of "/" due to checking emptiness after stripping leading slashes
rather than checking the full original argument string.
simplified from patch by Julien Ramseier.
Diffstat (limited to 'src/regex/glob.c')
-rw-r--r-- | src/regex/glob.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex/glob.c b/src/regex/glob.c index 5b6ff124..2d4d562e 100644 --- a/src/regex/glob.c +++ b/src/regex/glob.c @@ -179,7 +179,7 @@ int glob(const char *restrict pat, int flags, int (*errfunc)(const char *path, i if (strnlen(p, PATH_MAX+1) > PATH_MAX) return GLOB_NOSPACE; - if (*p) error = match_in_dir(d, p, flags, errfunc, &tail); + if (*pat) error = match_in_dir(d, p, flags, errfunc, &tail); if (error == GLOB_NOSPACE) { freelist(&head); return error; |