From 50ace4e250db43ba2ac84464444aba855e30bb63 Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 10 Aug 2014 05:11:08 -0300 Subject: [PATCH] Fix glib warnings when tab completing in weird places See github issue #125 for more details (or flyspray issue 124, submitted 10 years ago) --- src/fe-common/core/completion.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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--;