]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Client: manipulate history only if interactive
authorJan Moskyto Matejka <mq@ucw.cz>
Tue, 16 May 2017 13:47:41 +0000 (15:47 +0200)
committerJan Moskyto Matejka <mq@ucw.cz>
Tue, 16 May 2017 13:48:08 +0000 (15:48 +0200)
client/birdc.c

index 18e7c47b1b65ba8bd461064e41e90d7e515562c8..f1aea2fee60f819b3a0c45e01708ef776aa650aa 100644 (file)
@@ -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();
 }