1
0
Fork 0
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:
Tanaka Akira 1999-12-15 18:45:53 +00:00
parent 10c7dfab45
commit b9c19b15a6

View file

@ -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;
}