From: Richard M. Stallman Date: Wed, 13 May 1998 00:30:55 +0000 (+0000) Subject: (Fminibuffer_complete_word): Fix the string-comparison loop. X-Git-Tag: emacs-20.3~1029 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=669c6673fc321b34b052f0d1962545d439a4de88;p=emacs.git (Fminibuffer_complete_word): Fix the string-comparison loop. --- diff --git a/src/minibuf.c b/src/minibuf.c index f69f06f5ec9..bc86a912dd4 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1726,10 +1726,9 @@ Return nil if there is no valid completion, else t.") if (i <= 0) i = 1; start_pos= i; buffer_nchars -= i; - while (1) + while (i > 0) { - tem1 = Fcompare_strings (tem, make_number (start_pos), - make_number (buffer_nchars + start_pos), + tem1 = Fcompare_strings (tem, make_number (start_pos), Qnil, completion, make_number (0), make_number (buffer_nchars), completion_ignore_case ? Qt : Qnil); @@ -1737,6 +1736,7 @@ Return nil if there is no valid completion, else t.") if (EQ (tem1, Qt)) break; i++; + buffer_nchars--; } del_range (1, i + 1); SET_PT_BOTH (ZV, ZV_BYTE);