mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-13 13:41:01 +02:00
zsh-workers/10103
This commit is contained in:
parent
eaa55b5461
commit
2d69947427
1 changed files with 20 additions and 5 deletions
25
Src/glob.c
25
Src/glob.c
|
@ -479,11 +479,26 @@ scanner(Complist q)
|
||||||
/* Not the last path section. Just add it to the path. */
|
/* Not the last path section. Just add it to the path. */
|
||||||
int oppos = pathpos;
|
int oppos = pathpos;
|
||||||
|
|
||||||
if (!errflag && !(q->closure && !strcmp(str, "."))) {
|
if (!errflag) {
|
||||||
addpath(str);
|
int add = 1;
|
||||||
if (!closure || !statfullpath("", NULL, 1))
|
|
||||||
scanner((q->closure) ? q : q->next);
|
if (q->closure && *pathbuf) {
|
||||||
pathbuf[pathpos = oppos] = '\0';
|
if (!strcmp(str, "."))
|
||||||
|
add = 0;
|
||||||
|
else if (!strcmp(str, "..")) {
|
||||||
|
struct stat sc, sr;
|
||||||
|
|
||||||
|
add = (stat("/", &sr) || stat(pathbuf, &sc) ||
|
||||||
|
sr.st_ino != sc.st_ino ||
|
||||||
|
sr.st_dev != sc.st_dev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (add) {
|
||||||
|
addpath(str);
|
||||||
|
if (!closure || !statfullpath("", NULL, 1))
|
||||||
|
scanner((q->closure) ? q : q->next);
|
||||||
|
pathbuf[pathpos = oppos] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
insert(str, 0);
|
insert(str, 0);
|
||||||
|
|
Loading…
Reference in a new issue