stop adding empty strings to readline's history

This commit is contained in:
derselbst 2018-12-29 19:58:10 +01:00
parent 8634613509
commit 0f6c40c15e

View file

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