From e395a0eb6927f298fcc7d0764ed27605941f34c0 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 7 Apr 2016 15:24:52 -0700 Subject: Migrate PATH-completion logic from complete.cpp to expand.cpp Prior to this fix, when completing a command that doesn't have a /, we would prepend each component of PATH and then expand the whole thing. So any special characters in the PATH would be interpreted when performing tab completion. With this fix, we pull the PATH resolution out of complete.cpp and migrate it to expand.cpp. This unifies nicely with the CDPATH resolution already in that file. This requires introducing a new expand flag EXPAND_SPECIAL_FOR_COMMAND, which is analogous to EXPAND_SPECIAL_CD (which is renamed to EXPAND_SPECIAL_FOR_CD). This flag tells expand to resolve paths against PATH instead of the working directory. Fixes #952 --- tests/test6.out | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/test6.out') diff --git a/tests/test6.out b/tests/test6.out index 268b05ea..ca6e6906 100644 --- a/tests/test6.out +++ b/tests/test6.out @@ -33,3 +33,5 @@ CCCC: implicit cd complete works no implicit cd complete after 'command' PATH does not cause incorrect implicit cd +Command completion with parened PATHs test passed +Command completion with intermediate slashes passed -- cgit v1.2.3