From 0f6c40c15e20c8da57c314d047e9e899fae8d84c Mon Sep 17 00:00:00 2001 From: derselbst Date: Sat, 29 Dec 2018 19:58:10 +0100 Subject: [PATCH] stop adding empty strings to readline's history --- src/utils/fluid_sys.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index 4ac1344b..d686737f 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -1214,7 +1214,11 @@ fluid_istream_readline(fluid_istream_t in, fluid_ostream_t out, char *prompt, FLUID_SNPRINTF(buf, len, "%s", line); buf[len - 1] = 0; - add_history(buf); + + if(buf[0] != '\0') + { + add_history(buf); + } free(line); return 1;