completion: don't stop looking for candidates one byte too early

This fixes https://savannah.gnu.org/bugs/?67405.
Reported-by: Ivan Vorontsov <ivrntsv@yandex.ru>

Bug existed since version 2.7.2, since word completion was introduced.
This commit is contained in:
Benno Schulenberg 2025-08-07 15:23:04 +02:00
parent 1ee74172c2
commit 70e580c002

View File

@ -3165,7 +3165,7 @@ void complete_a_word(void)
/* Run through all of the lines in the buffer, looking for shard. */
while (pletion_line != NULL) {
ssize_t threshold = strlen(pletion_line->data) - shard_length - 1;
ssize_t threshold = strlen(pletion_line->data) - shard_length;
/* The point where we can stop searching for shard. */
completionstruct *some_word;
char *completion;