Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in completion for make



On Oct 18,  4:40pm, luc wrote:
}
} The pattern used in _make-parseMakefile (in case ...
} esac) is ([[:alnum:]][^$TAB:=]#:[^=]*) .  I do not understand why this
} matches a line starting with a TAB-character.

It's not the pattern that's the problem, it's the use of the "read"
builtin, which is stripping off the leading tab because a tab is in
the default value of $IFS.

We've had this come up elsewhere in completion functions.

diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
index 7b4c224..e5a513f 100644
--- a/Completion/Unix/Command/_make
+++ b/Completion/Unix/Command/_make
@@ -59,7 +59,7 @@ _make-expandVars() {
 }
 
 _make-parseMakefile () {
-  local input var val target dep TAB=$'\t' dir=$1 tmp
+  local input var val target dep TAB=$'\t' dir=$1 tmp IFS=
 
   while read input
   do



Messages sorted by: Reverse Date, Date, Thread, Author