Tomas Janousek 5a0cfd
			     BASH PATCH REPORT
Tomas Janousek 5a0cfd
			     =================
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
Bash-Release: 3.2
Tomas Janousek 5a0cfd
Patch-ID: bash32-017
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
Tomas Janousek 5a0cfd
Bug-Reference-ID: <1173636022.7039.36.camel@localhost>
Tomas Janousek 5a0cfd
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00039.html
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
Bug-Description:
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
When restoring the original prompt after finishing an incremental search,
Tomas Janousek 5a0cfd
bash sometimes places the cursor incorrectly if the primary prompt contains
Tomas Janousek 5a0cfd
invisible characters.
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
Patch:
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
*** ../bash-3.2.16/lib/readline/display.c	Fri Apr 20 13:30:16 2007
Tomas Janousek 5a0cfd
--- lib/readline/display.c	Fri Apr 20 15:17:01 2007
Tomas Janousek 5a0cfd
***************
Tomas Janousek 5a0cfd
*** 1599,1604 ****
Tomas Janousek 5a0cfd
  	  if (temp > 0)
Tomas Janousek 5a0cfd
  	    {
Tomas Janousek 5a0cfd
  	      _rl_output_some_chars (nfd, temp);
Tomas Janousek 5a0cfd
! 	      _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
Tomas Janousek 5a0cfd
  	    }
Tomas Janousek 5a0cfd
  	}
Tomas Janousek 5a0cfd
--- 1599,1618 ----
Tomas Janousek 5a0cfd
  	  if (temp > 0)
Tomas Janousek 5a0cfd
  	    {
Tomas Janousek 5a0cfd
+ 	      /* If nfd begins at the prompt, or before the invisible
Tomas Janousek 5a0cfd
+ 		 characters in the prompt, we need to adjust _rl_last_c_pos
Tomas Janousek 5a0cfd
+ 		 in a multibyte locale to account for the wrap offset and
Tomas Janousek 5a0cfd
+ 		 set cpos_adjusted accordingly. */
Tomas Janousek 5a0cfd
  	      _rl_output_some_chars (nfd, temp);
Tomas Janousek 5a0cfd
! 	      if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
Tomas Janousek 5a0cfd
! 		{
Tomas Janousek 5a0cfd
!                   _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
Tomas Janousek 5a0cfd
!                   if (current_line == 0 && wrap_offset &&  ((nfd - new) <= prompt_last_invisible))
Tomas Janousek 5a0cfd
! 		    {
Tomas Janousek 5a0cfd
! 		      _rl_last_c_pos -= wrap_offset;
Tomas Janousek 5a0cfd
! 		      cpos_adjusted = 1;
Tomas Janousek 5a0cfd
! 		    }
Tomas Janousek 5a0cfd
! 		}
Tomas Janousek 5a0cfd
!               else
Tomas Janousek 5a0cfd
!                 _rl_last_c_pos += temp;
Tomas Janousek 5a0cfd
  	    }
Tomas Janousek 5a0cfd
  	}
Tomas Janousek 5a0cfd
***************
Tomas Janousek 5a0cfd
*** 1608,1613 ****
Tomas Janousek 5a0cfd
--- 1622,1639 ----
Tomas Janousek 5a0cfd
  	  if (temp > 0)
Tomas Janousek 5a0cfd
  	    {
Tomas Janousek 5a0cfd
+ 	      /* If nfd begins at the prompt, or before the invisible
Tomas Janousek 5a0cfd
+ 		 characters in the prompt, we need to adjust _rl_last_c_pos
Tomas Janousek 5a0cfd
+ 		 in a multibyte locale to account for the wrap offset and
Tomas Janousek 5a0cfd
+ 		 set cpos_adjusted accordingly. */
Tomas Janousek 5a0cfd
  	      _rl_output_some_chars (nfd, temp);
Tomas Janousek 5a0cfd
  	      _rl_last_c_pos += col_temp;		/* XXX */
Tomas Janousek 5a0cfd
+ 	      if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
Tomas Janousek 5a0cfd
+ 		{
Tomas Janousek 5a0cfd
+ 		  if (current_line == 0 && wrap_offset &&  ((nfd - new) <= prompt_last_invisible))
Tomas Janousek 5a0cfd
+ 		    {
Tomas Janousek 5a0cfd
+ 		      _rl_last_c_pos -= wrap_offset;
Tomas Janousek 5a0cfd
+ 		      cpos_adjusted = 1;
Tomas Janousek 5a0cfd
+ 		    }
Tomas Janousek 5a0cfd
+ 		}
Tomas Janousek 5a0cfd
  	    }
Tomas Janousek 5a0cfd
  	  lendiff = (oe - old) - (ne - new);
Tomas Janousek 5a0cfd
*** ../bash-3.2/patchlevel.h	Thu Apr 13 08:31:04 2006
Tomas Janousek 5a0cfd
--- patchlevel.h	Mon Oct 16 14:22:54 2006
Tomas Janousek 5a0cfd
***************
Tomas Janousek 5a0cfd
*** 26,30 ****
Tomas Janousek 5a0cfd
     looks for to find the patch level (for the sccs version string). */
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
! #define PATCHLEVEL 16
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
  #endif /* _PATCHLEVEL_H_ */
Tomas Janousek 5a0cfd
--- 26,30 ----
Tomas Janousek 5a0cfd
     looks for to find the patch level (for the sccs version string). */
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
! #define PATCHLEVEL 17
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
  #endif /* _PATCHLEVEL_H_ */