about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-01-13 12:19:53 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-01-13 12:19:53 +0000
commit0cf040f4bf50c5530bd19da76ea234e2cd831667 (patch)
tree3249b38bb7eed7adc09358d9f0f12b53c9870af8
parente7c9e03c58f04a04c35a0e4c3721f939ba5e58c2 (diff)
downloadzsh-0cf040f4bf50c5530bd19da76ea234e2cd831667.tar.gz
zsh-0cf040f4bf50c5530bd19da76ea234e2cd831667.tar.xz
zsh-0cf040f4bf50c5530bd19da76ea234e2cd831667.zip
Back off 26270 (accept-and-menu-complete).
Was causing memory corruption
-rw-r--r--ChangeLog8
-rw-r--r--Completion/Base/Utility/_values2
-rw-r--r--Doc/Zsh/compwid.yo11
-rw-r--r--Src/Zle/compcore.c1
-rw-r--r--Src/Zle/complete.c4
-rw-r--r--Src/Zle/compresult.c24
6 files changed, 19 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ee34773b..b09759376 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-01-13  Peter Stephenson  <pws@csr.com>
 
+	* unposted: Completion/Base/Utility/_values, Doc/Zsh/compwid.yo,
+	Src/Zle/compcore.c, Src/Zle/complete.c, Src/Zle/compresult.c:
+	Back off 26270 and follow up; was causing memory corruption.
+
 	* Doc/Zsh/mod_zpty.yo, Src/Modules/zpty.c, Test/comptest:
 	make "zpty -r" exit more cleanly on read failures and add and
 	use option to ensure a pattern has been matched.
@@ -14,7 +18,7 @@
 	using dollar Revision dollar.
 
 	* 26272: Doc/Zsh/params.yo, Src/params.c, Src/zsh.mdd: extract
-	Revision from ChangeLog for use in $ZSH_PATCHLEVEL.	
+	Revision from ChangeLog for use in $ZSH_PATCHLEVEL.
 
 	* unposted: add RCS Revision tag for use in patchlevel
 	recording.
@@ -10897,5 +10901,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4505 $                         
+* $Revision: 1.4506 $                         
 *****************************************************
diff --git a/Completion/Base/Utility/_values b/Completion/Base/Utility/_values
index a478a8517..52c42bc70 100644
--- a/Completion/Base/Utility/_values
+++ b/Completion/Base/Utility/_values
@@ -12,8 +12,6 @@ if compvalues -i "$@"; then
   local noargs args opts descr action expl sep argsep subc test='*'
   local oldcontext="$curcontext"
 
-  compstate[list_in_word]=1
-
   compvalues -S argsep
   compvalues -s sep && [[ -n "$sep" ]] && test="[^${(q)sep}]#"
 
diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo
index 6c944bc2e..80427330d 100644
--- a/Doc/Zsh/compwid.yo
+++ b/Doc/Zsh/compwid.yo
@@ -280,20 +280,11 @@ done for the tt(LIST_ROWS_FIRST) option with the substring tt(rows).
 Finally, if the value contains the string tt(explanations), only the
 explanation strings, if any, will be listed and if it contains
 tt(messages), only the messages (added with the tt(-x) option of
-tt(compadd)) will be listed.  If it contains both tt(explanations) and 
+tt(compadd)) will be listed.  If it contains both tt(explanations) and
 tt(messages) both kinds of explanation strings will be listed.  It
 will be set appropriately on entry to a completion widget and may be
 changed there.
 )
-vindex(list_in_word, compstate)
-item(tt(list_in_word))(
-This controls how the tt(accept-and-menu-complete) widget handles
-suffixes.  If it is set to tt(0) (the default), the suffix is
-treated in accordance with the usual rules (typically being removed
-and replaced by a space, if marked for this treatment).  If set to
-tt(1), the suffix is preserved so that the next match will be inserted
-in the same word.
-)
 vindex(list_lines, compstate)
 item(tt(list_lines))(
 This gives the number of lines that are needed to display the full
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index 40c5f19ca..529537d37 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -325,7 +325,6 @@ do_completion(UNUSED(Hookdef dummy), Compldat dat)
     comppatinsert = ztrdup("menu");
     forcelist = 0;
     haspattern = 0;
-    complistinword = 0;
     complistmax = getiparam("LISTMAX");
     zsfree(complastprompt);
     complastprompt = ztrdup(((isset(ALWAYSLASTPROMPT) && zmult == 1) ||
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 7dbae1dee..6398fd3e7 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -38,7 +38,6 @@ zlong compcurrent,
       complistmax;
 /**/
 zlong complistlines,
-      complistinword,
       compignored;
 
 /**/
@@ -1147,7 +1146,6 @@ static struct compparam compkparams[] = {
       GSU(unambig_pos_gsu) },
     { "insert_positions", PM_SCALAR | PM_READONLY, NULL,
       GSU(insert_pos_gsu) },
-    { "list_in_word", PM_INTEGER, VAL(complistinword), NULL },
     { "list_max", PM_INTEGER, VAL(complistmax), NULL },
     { "last_prompt", PM_SCALAR, VAL(complastprompt), NULL },
     { "to_end", PM_SCALAR, VAL(comptoend), NULL },
@@ -1598,7 +1596,7 @@ setup_(UNUSED(Module m))
 	compvared = compqstack = NULL;
     complastprefix = ztrdup("");
     complastsuffix = ztrdup("");
-    complistmax = complistinword = 0;
+    complistmax = 0;
     hascompmod = 1;
 
     return 0;
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 630c7634c..e595802dd 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1309,23 +1309,21 @@ accept_last(void)
 	lastbrbeg->str[l] = ',';
 	lastbrbeg->str[l + 1] = '\0';
     } else {
-	zlemetacs = minfo.pos + minfo.len + minfo.insc;
-	if (!complistinword) {
-	    int l;
+	int l;
 
-	    iremovesuffix(' ', 1);
-	    l = zlemetacs;
-	    zlemetacs = minfo.pos + minfo.len + minfo.insc - (*(minfo.cur))->qisl;
-	    if (zlemetacs < l)
-		foredel(l - zlemetacs, CUT_RAW);
-	    else if (zlemetacs > zlemetall)
-		zlemetacs = zlemetall;
-	    inststrlen(" ", 1, 1);
-	}
+	zlemetacs = minfo.pos + minfo.len + minfo.insc;
+	iremovesuffix(' ', 1);
+	l = zlemetacs;
+	zlemetacs = minfo.pos + minfo.len + minfo.insc - (*(minfo.cur))->qisl;
+	if (zlemetacs < l)
+	    foredel(l - zlemetacs, CUT_RAW);
+	else if (zlemetacs > zlemetall)
+	    zlemetacs = zlemetall;
+	inststrlen(" ", 1, 1);
 	minfo.insc = minfo.len = 0;
 	minfo.pos = zlemetacs;
 	minfo.we = 1;
-	}
+    }
 
     if (!wasmeta)
 	unmetafy_line();