zsh-workers
 help / color / mirror / code / Atom feed
* [stew@vireo.org: Bug#295511: patch]
@ 2005-03-02  5:28 Clint Adams
  2005-03-02 18:51 ` Wayne Davison
  0 siblings, 1 reply; 4+ messages in thread
From: Clint Adams @ 2005-03-02  5:28 UTC (permalink / raw)
  To: zsh-workers

Wayne, any thoughts?

----- Forwarded message from Mike O'Connor <stew@vireo.org> -----

Here is a patch that seems to fix this bug.  What I have done is to
alter the _make completion functions so that recursion in expanding
variables is limited to only going 10 levels deep.

-stew


diff -ru zsh-4.2.4/Completion/Unix/Command/_make zsh-4.2.4-makecompletionfix/Completion/Unix/Command/_make
--- zsh-4.2.4/Completion/Unix/Command/_make	2005-03-01 23:17:01.000000000 -0500
+++ zsh-4.2.4-makecompletionfix/Completion/Unix/Command/_make	2005-03-01 23:16:18.000000000 -0500
@@ -3,7 +3,10 @@
 local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl
 
 expandVars() {
-    local open close var val tmp=$1 ret=$1
+    local open close var val tmp=$2 ret=$2
+    if (( $1 == 0 )); then
+	return
+    fi
     while :; do
 	var=${tmp#*\$}
 	if [[ $var != $tmp ]]; then
@@ -37,7 +40,7 @@
 	    case $var in
 	    ([[:alnum:]_]#)
 		val=${(P)var}
-		val=$(expandVars $val)
+		val=$(expandVars $(($1 - 1)) $val)
 		ret=${ret//\$$open$var$close/$val}
 		;;
 	    esac
@@ -63,12 +66,12 @@
 	    var=${input%%[ $TAB]#:=*}
 	    val=${input#*=}
 	    val=${val##[ $TAB]#}
-	    val=$(expandVars $val)
+	    val=$(expandVars 10 $val)
 	    eval $var=\$val
 	    ;;
 	([[:alnum:]][^$TAB:=]#:[^=]*)
 	    input=${input%%:*}
-	    print $(expandVars $input)
+	    print $(expandVars 10 $input)
 	    ;;
 	($incl *)
 	    local f=${input##$incl ##}
@@ -76,7 +79,7 @@
 		f=${f#[\"<]}
 		f=${f%[\">]}
 	    fi
-	    f=$(expandVars $f)
+	    f=$(expandVars 10 $f)
 	    case $f in
 	    (/*) ;;
 	    (*)  f=$dir/$f ;;




----- End forwarded message -----


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-03-02 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-02  5:28 [stew@vireo.org: Bug#295511: patch] Clint Adams
2005-03-02 18:51 ` Wayne Davison
2005-03-02 19:17   ` Wayne Davison
2005-03-02 20:25   ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).