1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

Fix `read -e' handling when PS1 is longer than the terminal width

<http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=139306>

Obtained from:	Tim Waugh <twaugh@redhat.com>
This commit is contained in:
Oliver Eikemeier 2004-11-19 13:44:37 +00:00
parent b45aa2855c
commit d8f7447a12
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=121960
2 changed files with 25 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= bash
PORTVERSION= 3.0.${PATCHLEVEL}
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= shells
MASTER_SITES= ${MASTER_SITE_GNU:S/$/:bash/} \
http://cnswww.cns.cwru.edu/~chet/%SUBDIR%/:faq \

View File

@ -0,0 +1,24 @@
#
# Fix handling of `read -e' while PS1 is set longer than the screen width
#
# http://lists.gnu.org/archive/html/bug-bash/2004-11/msg00220.html
# http://lists.gnu.org/archive/html/bug-bash/2004-11/msg00266.html
#
--- lib/readline/display.c.orig 2004-11-18 16:24:46.000000000 +0000
+++ lib/readline/display.c 2004-11-18 17:12:32.904903404 +0000
@@ -572,11 +572,10 @@
/* inv_lbreaks[i] is where line i starts in the buffer. */
inv_lbreaks[newlines = 0] = 0;
-#if 0
- lpos = out - wrap_offset;
-#else
- lpos = prompt_physical_chars + modmark;
-#endif
+ if (local_prompt)
+ lpos = prompt_physical_chars + modmark;
+ else
+ lpos = 0;
#if defined (HANDLE_MULTIBYTE)
memset (_rl_wrapped_line, 0, vis_lbsize);