mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 16:50:58 +01:00
39949: Special case for "-" in directory names.
It can be sh-tokenized to Dash to allow for appearing in ranges after substitution, so needs to be turned back to "-" in that case.
This commit is contained in:
parent
e9dbfa8046
commit
921b39ac6b
4 changed files with 59 additions and 39 deletions
16
Src/subst.c
16
Src/subst.c
|
|
@ -684,19 +684,19 @@ filesubstr(char **namptr, int assign)
|
|||
*namptr = dyncat(ds, ptr);
|
||||
return 1;
|
||||
} else if ((ptr = itype_end(str+1, IUSER, 0)) != str+1) { /* ~foo */
|
||||
char *hom, save;
|
||||
char *untok, *hom;
|
||||
|
||||
save = *ptr;
|
||||
if (!isend(save))
|
||||
if (!isend(*ptr))
|
||||
return 0;
|
||||
*ptr = 0;
|
||||
if (!(hom = getnameddir(++str))) {
|
||||
untok = dupstring(++str);
|
||||
untok[ptr-str] = 0;
|
||||
untokenize(untok);
|
||||
|
||||
if (!(hom = getnameddir(untok))) {
|
||||
if (isset(NOMATCH) && isset(EXECOPT))
|
||||
zerr("no such user or named directory: %s", str);
|
||||
*ptr = save;
|
||||
zerr("no such user or named directory: %s", untok);
|
||||
return 0;
|
||||
}
|
||||
*ptr = save;
|
||||
*namptr = dyncat(hom, ptr);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue