summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/lib/libreadline/display.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/lib/libreadline/display.c b/gnu/lib/libreadline/display.c
index 66ddc435448f..07fc909e2f41 100644
--- a/gnu/lib/libreadline/display.c
+++ b/gnu/lib/libreadline/display.c
@@ -746,7 +746,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
escape sequences (like drawing the `unbold' sequence without a
corresponding `bold') that manifests itself on certain terminals. */
- lendiff = strlen (local_prompt);
+ lendiff = local_prompt ? strlen (local_prompt) : 0;
if (current_line == 0 && !_rl_horizontal_scroll_mode &&
lendiff > visible_length &&
_rl_last_c_pos > 0 && (ofd - old) >= lendiff && term_cr)