Fix glib warnings when tab completing in weird places

See github issue #125 for more details
(or flyspray issue 124, submitted 10 years ago)
This commit is contained in:
dequis 2014-08-10 05:11:08 -03:00
commit 50ace4e250

View file

@ -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--;