degesch: fix usage of "prompt_shown"

It can go very negative.
This commit is contained in:
Přemysl Eric Janouch 2015-07-05 17:29:44 +02:00
parent 550f8baa1a
commit ff20e74868

View File

@ -202,11 +202,11 @@ input_set_prompt (struct input *self, char *prompt)
// First reset the prompt to work around a bug in readline // First reset the prompt to work around a bug in readline
rl_set_prompt (""); rl_set_prompt ("");
if (self->prompt_shown) if (self->prompt_shown > 0)
rl_redisplay (); rl_redisplay ();
rl_set_prompt (self->prompt); rl_set_prompt (self->prompt);
if (self->prompt_shown) if (self->prompt_shown > 0)
rl_redisplay (); rl_redisplay ();
} }
@ -255,7 +255,7 @@ input_insert_c (struct input *self, int c)
char s[2] = { c, 0 }; char s[2] = { c, 0 };
rl_insert_text (s); rl_insert_text (s);
if (self->prompt_shown) if (self->prompt_shown > 0)
rl_redisplay (); rl_redisplay ();
} }
@ -350,7 +350,7 @@ input_restore_buffer (struct input *self, struct input_buffer *buffer)
free (buffer->saved_line); free (buffer->saved_line);
buffer->saved_line = NULL; buffer->saved_line = NULL;
if (self->prompt_shown) if (self->prompt_shown > 0)
rl_redisplay (); rl_redisplay ();
} }
} }