psss / rpms / bash

Forked from rpms/bash 6 years ago
Clone
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-027
Tomas Janousek 4fb0991
Tomas Janousek 4fb0991
Bug-Reported-by:	dAniel hAhler <ubuntu@thequod.de>
Tomas Janousek 4fb0991
Bug-Reference-ID:	<4702ED8A.5000503@thequod.de>
Tomas Janousek 4fb0991
Bug-Reference-URL:	https://bugs.launchpad.net/ubuntu/+source/bash/+bug/119938
Tomas Janousek 4fb0991
Tomas Janousek 4fb0991
Bug-Description:
Tomas Janousek 4fb0991
Tomas Janousek 4fb0991
When updating the display after displaying, for instance, a list of possible
Tomas Janousek 4fb0991
completions, readline will place the cursor at the wrong position if the
Tomas Janousek 4fb0991
prompt contains invisible characters and a newline.
Tomas Janousek 4fb0991
Tomas Janousek 4fb0991
Patch:
Tomas Janousek 4fb0991
Tomas Janousek 4fb0991
*** ../bash-3.2.25/lib/readline/display.c	Mon Aug  6 14:26:29 2007
Tomas Janousek 4fb0991
--- lib/readline/display.c	Wed Oct 10 22:43:58 2007
Tomas Janousek 4fb0991
***************
Tomas Janousek 4fb0991
*** 1049,1053 ****
Tomas Janousek 4fb0991
  	      else
Tomas Janousek 4fb0991
  		tx = nleft;
Tomas Janousek 4fb0991
! 	      if (_rl_last_c_pos > tx)
Tomas Janousek 4fb0991
  		{
Tomas Janousek 4fb0991
  	          _rl_backspace (_rl_last_c_pos - tx);	/* XXX */
Tomas Janousek 4fb0991
--- 1049,1053 ----
Tomas Janousek 4fb0991
  	      else
Tomas Janousek 4fb0991
  		tx = nleft;
Tomas Janousek 4fb0991
! 	      if (tx >= 0 && _rl_last_c_pos > tx)
Tomas Janousek 4fb0991
  		{
Tomas Janousek 4fb0991
  	          _rl_backspace (_rl_last_c_pos - tx);	/* XXX */
Tomas Janousek 4fb0991
***************
Tomas Janousek 4fb0991
*** 1205,1209 ****
Tomas Janousek 4fb0991
  {
Tomas Janousek 4fb0991
    register char *ofd, *ols, *oe, *nfd, *nls, *ne;
Tomas Janousek 4fb0991
!   int temp, lendiff, wsatend, od, nd;
Tomas Janousek 4fb0991
    int current_invis_chars;
Tomas Janousek 4fb0991
    int col_lendiff, col_temp;
Tomas Janousek 4fb0991
--- 1205,1209 ----
Tomas Janousek 4fb0991
  {
Tomas Janousek 4fb0991
    register char *ofd, *ols, *oe, *nfd, *nls, *ne;
Tomas Janousek 4fb0991
!   int temp, lendiff, wsatend, od, nd, o_cpos;
Tomas Janousek 4fb0991
    int current_invis_chars;
Tomas Janousek 4fb0991
    int col_lendiff, col_temp;
Tomas Janousek 4fb0991
***************
Tomas Janousek 4fb0991
*** 1466,1469 ****
Tomas Janousek 4fb0991
--- 1466,1471 ----
Tomas Janousek 4fb0991
      }
Tomas Janousek 4fb0991
  
Tomas Janousek 4fb0991
+   o_cpos = _rl_last_c_pos;
Tomas Janousek 4fb0991
+ 
Tomas Janousek 4fb0991
    /* When this function returns, _rl_last_c_pos is correct, and an absolute
Tomas Janousek 4fb0991
       cursor postion in multibyte mode, but a buffer index when not in a
Tomas Janousek 4fb0991
***************
Tomas Janousek 4fb0991
*** 1475,1479 ****
Tomas Janousek 4fb0991
       invisible characters in the prompt string.  Let's see if setting this when
Tomas Janousek 4fb0991
       we make sure we're at the end of the drawn prompt string works. */
Tomas Janousek 4fb0991
!   if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars)
Tomas Janousek 4fb0991
      cpos_adjusted = 1;
Tomas Janousek 4fb0991
  #endif
Tomas Janousek 4fb0991
--- 1477,1483 ----
Tomas Janousek 4fb0991
       invisible characters in the prompt string.  Let's see if setting this when
Tomas Janousek 4fb0991
       we make sure we're at the end of the drawn prompt string works. */
Tomas Janousek 4fb0991
!   if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && 
Tomas Janousek 4fb0991
!       (_rl_last_c_pos > 0 || o_cpos > 0) &&
Tomas Janousek 4fb0991
!       _rl_last_c_pos == prompt_physical_chars)
Tomas Janousek 4fb0991
      cpos_adjusted = 1;
Tomas Janousek 4fb0991
  #endif
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 26
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 27
Tomas Janousek 4fb0991
  
Tomas Janousek 4fb0991
  #endif /* _PATCHLEVEL_H_ */