mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-26 05:51:08 +02:00
zsh-workers/9065
This commit is contained in:
parent
10c7dfab45
commit
b9c19b15a6
1 changed files with 5 additions and 2 deletions
|
@ -951,8 +951,11 @@ cd_try_chdir(char *pfix, char *dest, int hard)
|
||||||
else
|
else
|
||||||
unmetafy(buf, &dlen);
|
unmetafy(buf, &dlen);
|
||||||
|
|
||||||
if (lchdir(dest, NULL, hard)) /* Try plain relative first */
|
/* We try the full path first. If that fails, try the
|
||||||
if (lchdir(buf, NULL, hard)) {
|
* argument to cd relatively. This is useful if the cwd
|
||||||
|
* or a parent directory is renamed in the interim.
|
||||||
|
*/
|
||||||
|
if (lchdir(buf, NULL, hard) && lchdir(dest, NULL, hard)) {
|
||||||
free(buf);
|
free(buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue