Skip to content

Commit

Permalink
Do not treat cd "" as equivalent to cd ".".
Browse files Browse the repository at this point in the history
  • Loading branch information
hvdijk committed Sep 21, 2019
1 parent 43e2f10 commit ff3feeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ cdcmd(int argc, char **argv)
}
if (!dest)
dest = nullstr;
if (!*dest)
goto err;
if (*dest == '/')
goto step6;
if (*dest == '.') {
Expand All @@ -130,8 +132,6 @@ cdcmd(int argc, char **argv)
goto dotdot;
}
}
if (!*dest)
dest = ".";
path = bltinlookup("CDPATH");
while (p = path, (len = padvance(&path, dest)) >= 0) {
c = *p;
Expand Down

0 comments on commit ff3feeb

Please sign in to comment.