summaryrefslogtreecommitdiff
path: root/src/posix/posix-cd.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-10-11 11:39:40 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-10-11 11:39:40 +0000
commitf19e58049045ab6395d746d4280404a6595e613a (patch)
treed843d76c6eeefdfd10a745d343b4e76579d8b355 /src/posix/posix-cd.c
parent3f8f8c27374f72075a30e57011a31c816136a94b (diff)
downloadexecline-f19e58049045ab6395d746d4280404a6595e613a.tar.xz
Make posix-cd's CDPATH testing even more horrible
Diffstat (limited to 'src/posix/posix-cd.c')
-rw-r--r--src/posix/posix-cd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/posix/posix-cd.c b/src/posix/posix-cd.c
index f825be1..1addd8e 100644
--- a/src/posix/posix-cd.c
+++ b/src/posix/posix-cd.c
@@ -55,7 +55,7 @@ int main (int argc, char const **argv, char const *const *envp)
}
if (!where || !where[0]) dieusage() ;
- if ((where[0] != '/' && (where[0] != '.')) || (where[1] && where[1] != '.'))
+ if (!(where[0] == '/' || (where[0] == '.' && (!where[1] || where[1] == '/' || (where[1] == '.' && (!where[2] || where[2] == '/'))))))
{
char const *cdpath = getenv("CDPATH") ;
if (cdpath)