From 3eca46285932a5412e1191e8c0d29609f2a72c74 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 3 Jul 2001 22:21:40 +0000 Subject: [PATCH] Removed GLIB warning at certain condition with tab completion. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1606 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- 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 16427610..b9a2b3b0 100644 --- a/src/fe-common/core/completion.c +++ b/src/fe-common/core/completion.c @@ -188,7 +188,8 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos) /* replace the word in line - we need to return a full new line */ result = g_string_new(line); - g_string_erase(result, startpos, wordlen); + if (wordlen > 0) + g_string_erase(result, startpos, wordlen); g_string_insert(result, startpos, complist->data); if (want_space) {