aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-05 17:29:44 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-05 17:29:44 +0200
commitff20e748683ef98a98b47c481aa620e95499e50c (patch)
treecd34aa9d5f463764deed3f2453b6e4be2cd22454
parent550f8baa1a4f31abdde03a21fd35ce415d959986 (diff)
downloadxK-ff20e748683ef98a98b47c481aa620e95499e50c.tar.gz
xK-ff20e748683ef98a98b47c481aa620e95499e50c.tar.xz
xK-ff20e748683ef98a98b47c481aa620e95499e50c.zip
degesch: fix usage of "prompt_shown"
It can go very negative.
-rw-r--r--degesch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/degesch.c b/degesch.c
index 1e59f50..bfaf9ea 100644
--- a/degesch.c
+++ b/degesch.c
@@ -202,11 +202,11 @@ input_set_prompt (struct input *self, char *prompt)
// First reset the prompt to work around a bug in readline
rl_set_prompt ("");
- if (self->prompt_shown)
+ if (self->prompt_shown > 0)
rl_redisplay ();
rl_set_prompt (self->prompt);
- if (self->prompt_shown)
+ if (self->prompt_shown > 0)
rl_redisplay ();
}
@@ -255,7 +255,7 @@ input_insert_c (struct input *self, int c)
char s[2] = { c, 0 };
rl_insert_text (s);
- if (self->prompt_shown)
+ if (self->prompt_shown > 0)
rl_redisplay ();
}
@@ -350,7 +350,7 @@ input_restore_buffer (struct input *self, struct input_buffer *buffer)
free (buffer->saved_line);
buffer->saved_line = NULL;
- if (self->prompt_shown)
+ if (self->prompt_shown > 0)
rl_redisplay ();
}
}