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