aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-05-12 07:07:02 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-05-12 07:09:20 +0200
commitc5b38842bf34cf914d926dec844aac93bf197207 (patch)
treee511d013153af80bfa568ada02637c9dd4e63108
parent24546dd7241de7d2af7cae06b1a7900fa9c3eb40 (diff)
downloadxK-c5b38842bf34cf914d926dec844aac93bf197207.tar.gz
xK-c5b38842bf34cf914d926dec844aac93bf197207.tar.xz
xK-c5b38842bf34cf914d926dec844aac93bf197207.zip
degesch: input_set_prompt() can be called whenever
-rw-r--r--degesch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index e7310c9..f3ad894 100644
--- a/degesch.c
+++ b/degesch.c
@@ -197,6 +197,9 @@ input_set_prompt (struct input *self, char *prompt)
free (self->prompt);
self->prompt = prompt;
+ if (!self->active)
+ return;
+
// First reset the prompt to work around a bug in readline
rl_set_prompt ("");
if (self->prompt_shown)
@@ -294,6 +297,7 @@ input_stop (struct input *self)
// This is okay as long as we're not called from within readline
rl_callback_handler_remove ();
self->active = false;
+ self->prompt_shown = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -591,6 +595,7 @@ input_stop (struct input *self)
el_end (self->editline);
self->editline = NULL;
self->active = false;
+ self->prompt_shown = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -