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

Re: Bug#455070: zsh: make completion: please add support for -include



On 2007-12-09 02:26:58 +0100, Vincent Lefevre wrote:
> prunille:~> incl="(-|)include"
> prunille:~> echo ${input##(-|)include ##}
> foo
> prunille:~> echo ${input##$incl ##}
> include foo

But:

prunille:~> echo ${input##${~incl} ##}
foo

The attached patch works, but I'm not sure it is correct.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
--- functions/Completion/Unix/_make	2007-12-09 02:08:38.000000000 +0100
+++ share/zsh/site-functions/_make	2007-12-09 02:32:49.000000000 +0100
@@ -81,8 +81,8 @@
 	    input=${input%%:*}
 	    print $(expandVars 10 $input)
 	    ;;
-	($incl *)
-	    local f=${input##$incl ##}
+	(${~incl} *)
+	    local f=${input##${~incl} ##}
 	    if [[ $incl = '.include' ]]; then
 		f=${f#[\"<]}
 		f=${f%[\">]}
@@ -125,7 +125,7 @@
 _pick_variant -r is_gnu gnu=GNU unix -v -f
 
 if [[ $is_gnu = gnu ]]; then
-    incl=include
+    incl="(-|)include"
 else
     incl=.include
 fi


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