07a490
			     BASH PATCH REPORT
07a490
			     =================
07a490
07a490
Bash-Release:	4.2
07a490
Patch-ID:	bash42-031
07a490
07a490
Bug-Reported-by:	Max Horn <max@quendi.de>
07a490
Bug-Reference-ID:	<20CC5C60-07C3-4E41-9817-741E48D407C5@quendi.de>
07a490
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-readline/2012-06/msg00005.html
07a490
07a490
Bug-Description:
07a490
07a490
A change between bash-4.1 and bash-4.2 to prevent the readline input hook
07a490
from being called too frequently had the side effect of causing delays
07a490
when reading pasted input on systems such as Mac OS X.  This patch fixes
07a490
those delays while retaining the bash-4.2 behavior.
07a490
07a490
Patch (apply with `patch -p0'):
07a490
07a490
*** ../bash-4.2-patched/lib/readline/input.c	2010-05-30 18:33:01.000000000 -0400
07a490
--- lib/readline/input.c	2012-06-25 21:08:42.000000000 -0400
07a490
***************
07a490
*** 410,414 ****
07a490
  rl_read_key ()
07a490
  {
07a490
!   int c;
07a490
  
07a490
    rl_key_sequence_length++;
07a490
--- 412,416 ----
07a490
  rl_read_key ()
07a490
  {
07a490
!   int c, r;
07a490
  
07a490
    rl_key_sequence_length++;
07a490
***************
07a490
*** 430,441 ****
07a490
  	  while (rl_event_hook)
07a490
  	    {
07a490
! 	      if (rl_gather_tyi () < 0)	/* XXX - EIO */
07a490
  		{
07a490
  		  rl_done = 1;
07a490
  		  return ('\n');
07a490
  		}
07a490
  	      RL_CHECK_SIGNALS ();
07a490
- 	      if (rl_get_char (&c) != 0)
07a490
- 		break;
07a490
  	      if (rl_done)		/* XXX - experimental */
07a490
  		return ('\n');
07a490
--- 432,447 ----
07a490
  	  while (rl_event_hook)
07a490
  	    {
07a490
! 	      if (rl_get_char (&c) != 0)
07a490
! 		break;
07a490
! 		
07a490
! 	      if ((r = rl_gather_tyi ()) < 0)	/* XXX - EIO */
07a490
  		{
07a490
  		  rl_done = 1;
07a490
  		  return ('\n');
07a490
  		}
07a490
+ 	      else if (r == 1)			/* read something */
07a490
+ 		continue;
07a490
+ 
07a490
  	      RL_CHECK_SIGNALS ();
07a490
  	      if (rl_done)		/* XXX - experimental */
07a490
  		return ('\n');
07a490
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
07a490
--- patchlevel.h	Thu Feb 24 21:41:34 2011
07a490
***************
07a490
*** 26,30 ****
07a490
     looks for to find the patch level (for the sccs version string). */
07a490
  
07a490
! #define PATCHLEVEL 30
07a490
  
07a490
  #endif /* _PATCHLEVEL_H_ */
07a490
--- 26,30 ----
07a490
     looks for to find the patch level (for the sccs version string). */
07a490
  
07a490
! #define PATCHLEVEL 31
07a490
  
07a490
  #endif /* _PATCHLEVEL_H_ */