[4.1] fb375e9 Do not add empty strings to the cli history
Lasse Karstensen
lkarsten at varnish-software.com
Tue Jun 14 11:42:09 CEST 2016
commit fb375e9bdd25c60c5900e0b262ff452fd95e4317
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Tue Apr 19 13:16:23 2016 +0100
Do not add empty strings to the cli history
diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index 621d696..e426f0b 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -190,7 +190,8 @@ static void send_line(char *l)
if (l) {
cli_write(_line_sock, l);
cli_write(_line_sock, "\n");
- add_history(l);
+ if (*l)
+ add_history(l);
rl_callback_handler_install("varnish> ", send_line);
} else {
RL_EXIT(0);
More information about the varnish-commit
mailing list