mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-25 17:41:19 +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
|
||||
unmetafy(buf, &dlen);
|
||||
|
||||
if (lchdir(dest, NULL, hard)) /* Try plain relative first */
|
||||
if (lchdir(buf, NULL, hard)) {
|
||||
/* We try the full path first. If that fails, try the
|
||||
* 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);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue