提交 84eff797 编写于 作者: R Rich Felker

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.
上级 bc313e88
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册