[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] prompt handling bug exposed since bash30-006
From: |
Tim Waugh |
Subject: |
[patch] prompt handling bug exposed since bash30-006 |
Date: |
Mon, 15 Nov 2004 18:37:04 +0000 |
User-agent: |
Mutt/1.4.1i |
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: i386-redhat-linux-gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_FILE_OFFSET_BITS=64 -O2 -g
-pipe -m32 -march=i386 -mtune=pentium4
uname output: Linux gene 2.6.9-1.640 #1 Wed Oct 20 09:55:51 EDT 2004 i686 i686
i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu
Bash Version: 3.0
Patch Level: 14
Release Status: release
Description:
The shell crashes when using 'read -e' while PS1 is set to a
prompt longer than the screen width. Original bug report:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=139306
Repeat-By:
bash
PS1=$(perl -e 'print "a"x80')
read -e FOO
Fix:
I don't know if this is correct, but it seems to fix the problem here
with no ill effects. Please sanity check it!
This problem affects bash-3.0 patchlevel 6 and upwards.
--- bash-3.0/lib/readline/display.c.read-e-segfault 2004-11-15
18:26:43.773691987 +0000
+++ bash-3.0/lib/readline/display.c 2004-11-15 18:28:49.871671242 +0000
@@ -492,6 +492,7 @@
}
line[out] = '\0';
wrap_offset = local_len - prompt_visible_length;
+ prompt_physical_chars = local_len;
}
else
{
- [patch] prompt handling bug exposed since bash30-006,
Tim Waugh <=