summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-05-16 15:47:41 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2017-05-16 15:48:08 +0200
commit31874783c44dd59c355921908016f9b42d22ef02 (patch)
tree3ea2a859eb025c1c5cebfda49f35b13a930a4277
parent05d47bd53e71480f1b276bd895f1c25088201e48 (diff)
Client: manipulate history only if interactive
-rw-r--r--client/birdc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/birdc.c b/client/birdc.c
index 18e7c47b..f1aea2fe 100644
--- a/client/birdc.c
+++ b/client/birdc.c
@@ -157,7 +157,8 @@ history_init(void)
void
input_init(void)
{
- history_init();
+ if (interactive)
+ history_init();
rl_readline_name = "birdc";
rl_add_defun("bird-complete", input_complete, '\t');
rl_add_defun("bird-help", input_help, '?');
@@ -235,6 +236,7 @@ cleanup(void)
return;
input_hide();
- write_history(history_file);
+ if (interactive)
+ write_history(history_file);
rl_callback_handler_remove();
}