From 71c93e5f0b6bab68aa69de0806b35d0e36c2001e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Diego=20Aur=C3=A9lio=20Mesquita?= Date: Fri, 27 Oct 2017 14:03:20 -0300 Subject: [PATCH] Fix segfault when creating a new empty buffer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Diego Aurélio Mesquita --- src/history.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/history.c b/src/history.c index 11cf6c2..3c19991 100644 --- a/src/history.c +++ b/src/history.c @@ -81,6 +81,9 @@ void update_history(filestruct **item, const char *text) { filestruct **htop = NULL, **hbot = NULL, *thesame; + if (text[0] == '\0') + return; + if (*item == search_history) { htop = &searchtop; hbot = &searchbot; -- 2.7.4