about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-14 08:57:08 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-14 08:57:08 +0000
commitb55f434b3931e7abe24b961b230da886d49e1b06 (patch)
tree6ed9d8d896eefbc0c400cb661ceae558b8182906
parent39d3ea13c1361b4b3f084eb3c0754008d58cfcdc (diff)
downloadzsh-b55f434b3931e7abe24b961b230da886d49e1b06.tar.gz
zsh-b55f434b3931e7abe24b961b230da886d49e1b06.tar.xz
zsh-b55f434b3931e7abe24b961b230da886d49e1b06.zip
zsh-workers/8244
-rw-r--r--Src/Zle/zle_tricky.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index be671ab50..66f4de33a 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -66,7 +66,7 @@ dopestring;
 /* The line before completion was tried. */
 
 static char *origline;
-static int origcs;
+static int origcs, origll;
 
 /* wb and we hold the beginning/end position of the word we are completing. */
 
@@ -936,6 +936,7 @@ docomplete(int lst)
     ocs = cs;
     origline = dupstring((char *) line);
     origcs = cs;
+    origll = ll;
     if (!isfirstln && chline != NULL) {
 	/* If we are completing in a multi-line buffer (which was not  *
 	 * taken from the history), we have to prepend the stuff saved *
@@ -8272,15 +8273,11 @@ do_ambiguous(void)
 	 * completion options.                                             */
 	do_ambig_menu();
     } else if (ainfo) {
-	int atend = (cs == we), oll = ll, la, eq, tcs;
-	VARARR(char, oline, ll);
+	int atend = (cs == we), la, eq, tcs;
 
 	minfo.cur = NULL;
 	minfo.asked = 0;
 
-	/* Copy the line buffer to be able to easily test if it changed. */
-	memcpy(oline, line, ll);
-
 	fixsuffix();
 
 	/* First remove the old string from the line. */
@@ -8299,7 +8296,7 @@ do_ambiguous(void)
 	/* la is non-zero if listambiguous may be used. Copying and
 	 * comparing the line looks like BFI but it is the easiest
 	 * solution. Really. */
-	la = (ll != oll || strncmp(oline, (char *) line, ll));
+	la = (ll != origll || strncmp(origline, (char *) line, ll));
 
 	/* If REC_EXACT and AUTO_MENU are set and what we inserted is an  *
 	 * exact match, we want menu completion the next time round       *