summaryrefslogtreecommitdiff
path: root/data/bash/bash40-023
blob: d2376c7dadcbbfcb594f500ed5eb882cc83c7ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
			     BASH PATCH REPORT
			     =================

Bash-Release: 4.0
Patch-ID: bash40-023

Bug-Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Bug-Reference-ID: <m21vrhhx08.fsf@igel.home>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00160.html

Bug-Description:

If the prompt length exactly matches the screen width, and the prompt ends
with invisible characters, readline positions the cursor incorrectly.

Patch:

*** ../bash-4.0-patched/lib/readline/display.c	2009-01-04 14:32:32.000000000 -0500
--- lib/readline/display.c	2009-04-25 21:42:18.000000000 -0400
***************
*** 1895,1898 ****
--- 1897,1904 ----
    woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
    cpos = _rl_last_c_pos;
+ 
+   if (cpos == 0 && cpos == new)
+     return;
+ 
  #if defined (HANDLE_MULTIBYTE)
    /* If we have multibyte characters, NEW is indexed by the buffer point in
***************
*** 1908,1914 ****
  	 desired display position. */
        if ((new > prompt_last_invisible) ||		/* XXX - don't use woff here */
! 	  (prompt_physical_chars > _rl_screenwidth &&
  	   _rl_last_v_pos == prompt_last_screen_line &&
! 	   wrap_offset >= woff &&
  	   new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
  	   /* XXX last comparison might need to be >= */
--- 1914,1920 ----
  	 desired display position. */
        if ((new > prompt_last_invisible) ||		/* XXX - don't use woff here */
! 	  (prompt_physical_chars >= _rl_screenwidth &&
  	   _rl_last_v_pos == prompt_last_screen_line &&
! 	   wrap_offset >= woff && dpos >= woff &&
  	   new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
  	   /* XXX last comparison might need to be >= */
*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 22
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 23
  
  #endif /* _PATCHLEVEL_H_ */