Tomas Janousek 9bf3d5
			     BASH PATCH REPORT
Tomas Janousek 9bf3d5
			     =================
Tomas Janousek 9bf3d5
Tomas Janousek 9bf3d5
Bash-Release: 3.2
Tomas Janousek 9bf3d5
Patch-ID: bash32-031
Tomas Janousek 9bf3d5
Tomas Janousek 9bf3d5
Bug-Reported-by:	Miroslav Lichvar <mlichvar@redhat.com>
Tomas Janousek 9bf3d5
Bug-Reference-ID:	Fri, 02 Nov 2007 14:07:45 +0100
Tomas Janousek 9bf3d5
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-readline/2007-11/msg00000.html
Tomas Janousek 9bf3d5
Tomas Janousek 9bf3d5
Bug-Description:
Tomas Janousek 9bf3d5
Tomas Janousek 9bf3d5
In certain cases when outputting characters at the end of the line,
Tomas Janousek 9bf3d5
e.g., when displaying the prompt string, readline positions the cursor
Tomas Janousek 9bf3d5
incorrectly if the prompt string contains invisible characters and the
Tomas Janousek 9bf3d5
text being drawn begins before the last invisible character in the line.
Tomas Janousek 9bf3d5
Tomas Janousek 9bf3d5
Patch:
Tomas Janousek 9bf3d5
Tomas Janousek 9bf3d5
*** ../bash-3.2-patched/lib/readline/display.c	2007-08-25 13:47:08.000000000 -0400
Tomas Janousek 9bf3d5
--- lib/readline/display.c	2007-11-10 17:51:29.000000000 -0500
Tomas Janousek 9bf3d5
***************
Tomas Janousek 9bf3d5
*** 1566,1574 ****
Tomas Janousek 9bf3d5
  	  else
Tomas Janousek 9bf3d5
  	    {
Tomas Janousek 9bf3d5
- 	      /* We have horizontal scrolling and we are not inserting at
Tomas Janousek 9bf3d5
- 		 the end.  We have invisible characters in this line.  This
Tomas Janousek 9bf3d5
- 		 is a dumb update. */
Tomas Janousek 9bf3d5
  	      _rl_output_some_chars (nfd, temp);
Tomas Janousek 9bf3d5
  	      _rl_last_c_pos += col_temp;
Tomas Janousek 9bf3d5
  	      return;
Tomas Janousek 9bf3d5
  	    }
Tomas Janousek 9bf3d5
--- 1619,1632 ----
Tomas Janousek 9bf3d5
  	  else
Tomas Janousek 9bf3d5
  	    {
Tomas Janousek 9bf3d5
  	      _rl_output_some_chars (nfd, temp);
Tomas Janousek 9bf3d5
  	      _rl_last_c_pos += col_temp;
Tomas Janousek 9bf3d5
+ 	      /* If nfd begins before any invisible characters in the prompt,
Tomas Janousek 9bf3d5
+ 		 adjust _rl_last_c_pos to account for wrap_offset and set
Tomas Janousek 9bf3d5
+ 		 cpos_adjusted to let the caller know. */
Tomas Janousek 9bf3d5
+ 	      if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
Tomas Janousek 9bf3d5
+ 		{
Tomas Janousek 9bf3d5
+ 		  _rl_last_c_pos -= wrap_offset;
Tomas Janousek 9bf3d5
+ 		  cpos_adjusted = 1;
Tomas Janousek 9bf3d5
+ 		}
Tomas Janousek 9bf3d5
  	      return;
Tomas Janousek 9bf3d5
  	    }
Tomas Janousek 9bf3d5
*** ../bash-3.2/patchlevel.h	Thu Apr 13 08:31:04 2006
Tomas Janousek 9bf3d5
--- patchlevel.h	Mon Oct 16 14:22:54 2006
Tomas Janousek 9bf3d5
***************
Tomas Janousek 9bf3d5
*** 26,30 ****
Tomas Janousek 9bf3d5
     looks for to find the patch level (for the sccs version string). */
Tomas Janousek 9bf3d5
  
Tomas Janousek 9bf3d5
! #define PATCHLEVEL 30
Tomas Janousek 9bf3d5
  
Tomas Janousek 9bf3d5
  #endif /* _PATCHLEVEL_H_ */
Tomas Janousek 9bf3d5
--- 26,30 ----
Tomas Janousek 9bf3d5
     looks for to find the patch level (for the sccs version string). */
Tomas Janousek 9bf3d5
  
Tomas Janousek 9bf3d5
! #define PATCHLEVEL 31
Tomas Janousek 9bf3d5
  
Tomas Janousek 9bf3d5
  #endif /* _PATCHLEVEL_H_ */