Roman Rakus 928cba
			     BASH PATCH REPORT
Roman Rakus 928cba
			     =================
Roman Rakus 928cba
Roman Rakus 928cba
Bash-Release: 4.0
Roman Rakus 928cba
Patch-ID: bash40-023
Roman Rakus 928cba
Roman Rakus 928cba
Bug-Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Roman Rakus 928cba
Bug-Reference-ID: <m21vrhhx08.fsf@igel.home>
Roman Rakus 928cba
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00160.html
Roman Rakus 928cba
Roman Rakus 928cba
Bug-Description:
Roman Rakus 928cba
Roman Rakus 928cba
If the prompt length exactly matches the screen width, and the prompt ends
Roman Rakus 928cba
with invisible characters, readline positions the cursor incorrectly.
Roman Rakus 928cba
Roman Rakus 928cba
Patch:
Roman Rakus 928cba
Roman Rakus 928cba
*** ../bash-4.0-patched/lib/readline/display.c	2009-01-04 14:32:32.000000000 -0500
Roman Rakus 928cba
--- lib/readline/display.c	2009-04-25 21:42:18.000000000 -0400
Roman Rakus 928cba
***************
Roman Rakus 928cba
*** 1895,1898 ****
Roman Rakus 928cba
--- 1897,1904 ----
Roman Rakus 928cba
    woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
Roman Rakus 928cba
    cpos = _rl_last_c_pos;
Roman Rakus 928cba
+ 
Roman Rakus 928cba
+   if (cpos == 0 && cpos == new)
Roman Rakus 928cba
+     return;
Roman Rakus 928cba
+ 
Roman Rakus 928cba
  #if defined (HANDLE_MULTIBYTE)
Roman Rakus 928cba
    /* If we have multibyte characters, NEW is indexed by the buffer point in
Roman Rakus 928cba
***************
Roman Rakus 928cba
*** 1908,1914 ****
Roman Rakus 928cba
  	 desired display position. */
Roman Rakus 928cba
        if ((new > prompt_last_invisible) ||		/* XXX - don't use woff here */
Roman Rakus 928cba
! 	  (prompt_physical_chars > _rl_screenwidth &&
Roman Rakus 928cba
  	   _rl_last_v_pos == prompt_last_screen_line &&
Roman Rakus 928cba
! 	   wrap_offset >= woff &&
Roman Rakus 928cba
  	   new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
Roman Rakus 928cba
  	   /* XXX last comparison might need to be >= */
Roman Rakus 928cba
--- 1914,1920 ----
Roman Rakus 928cba
  	 desired display position. */
Roman Rakus 928cba
        if ((new > prompt_last_invisible) ||		/* XXX - don't use woff here */
Roman Rakus 928cba
! 	  (prompt_physical_chars >= _rl_screenwidth &&
Roman Rakus 928cba
  	   _rl_last_v_pos == prompt_last_screen_line &&
Roman Rakus 928cba
! 	   wrap_offset >= woff && dpos >= woff &&
Roman Rakus 928cba
  	   new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
Roman Rakus 928cba
  	   /* XXX last comparison might need to be >= */
Roman Rakus 928cba
*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
Roman Rakus 928cba
--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
Roman Rakus 928cba
***************
Roman Rakus 928cba
*** 26,30 ****
Roman Rakus 928cba
     looks for to find the patch level (for the sccs version string). */
Roman Rakus 928cba
  
Roman Rakus 928cba
! #define PATCHLEVEL 22
Roman Rakus 928cba
  
Roman Rakus 928cba
  #endif /* _PATCHLEVEL_H_ */
Roman Rakus 928cba
--- 26,30 ----
Roman Rakus 928cba
     looks for to find the patch level (for the sccs version string). */
Roman Rakus 928cba
  
Roman Rakus 928cba
! #define PATCHLEVEL 23
Roman Rakus 928cba
  
Roman Rakus 928cba
  #endif /* _PATCHLEVEL_H_ */