From f19e58049045ab6395d746d4280404a6595e613a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 11 Oct 2019 11:39:40 +0000 Subject: Make posix-cd's CDPATH testing even more horrible --- src/posix/posix-cd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/posix') 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) -- cgit v1.2.3