Don't strip a leading ./ from the path for the cd builtin to avoid interpreting
.//dir as /dir. Rather strip it only for the purpose of checking if the directory path should be printed. PR: 88813 Submitted by: Josh Elsasser Patch from: NetBSD (cd.c rev 1.38) MFC after: 2 weeks
This commit is contained in:
parent
0b3691a359
commit
ed5c24e27d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159551
@ -124,8 +124,9 @@ cdcmd(int argc, char **argv)
|
|||||||
* XXX - rethink
|
* XXX - rethink
|
||||||
*/
|
*/
|
||||||
if (p[0] == '.' && p[1] == '/' && p[2] != '\0')
|
if (p[0] == '.' && p[1] == '/' && p[2] != '\0')
|
||||||
p += 2;
|
print = strcmp(p + 2, dest);
|
||||||
print = strcmp(p, dest);
|
else
|
||||||
|
print = strcmp(p, dest);
|
||||||
}
|
}
|
||||||
if (docd(p, print, phys) >= 0)
|
if (docd(p, print, phys) >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user