From b55f434b3931e7abe24b961b230da886d49e1b06 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 14 Oct 1999 08:57:08 +0000 Subject: zsh-workers/8244 --- Src/Zle/zle_tricky.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Src') 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 * -- cgit 1.4.1