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