diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c index 31d62e10..9877b83e 100644 --- a/src/fe-common/core/completion.c +++ b/src/fe-common/core/completion.c @@ -162,7 +162,8 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i if (isseparator(*line)) { /* empty space at the start of line */ if (wordstart == line) - wordstart += strlen(wordstart); + while (wordstart != '\0' && isseparator(wordstart)) + wordstart++; } else { while (wordstart > line && isseparator(wordstart[-1])) wordstart--;