readline52-007.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. READLINE PATCH REPORT
  2. =====================
  3. Readline-Release: 5.2
  4. Patch-ID: readline52-007
  5. Bug-Reported-by: Tom Bjorkholm <tom.bjorkholm@ericsson.com>
  6. Bug-Reference-ID: <AEA1A32F001C6B4F98614B5B80D7647D01C075E9@esealmw115.eemea.ericsson.se>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-04/msg00004.html
  8. Bug-Description:
  9. An off-by-one error in readline's input buffering caused readline to drop
  10. each 511th character of buffered input (e.g., when pasting a large amount
  11. of data into a terminal window).
  12. Patch:
  13. *** ../readline-5.2/input.c Wed Aug 16 15:15:16 2006
  14. --- ./input.c Tue Jul 17 09:24:21 2007
  15. ***************
  16. *** 134,139 ****
  17. *key = ibuffer[pop_index++];
  18. !
  19. if (pop_index >= ibuffer_len)
  20. pop_index = 0;
  21. --- 134,142 ----
  22. *key = ibuffer[pop_index++];
  23. ! #if 0
  24. if (pop_index >= ibuffer_len)
  25. + #else
  26. + if (pop_index > ibuffer_len)
  27. + #endif
  28. pop_index = 0;
  29. ***************
  30. *** 251,255 ****
  31. {
  32. k = (*rl_getc_function) (rl_instream);
  33. ! rl_stuff_char (k);
  34. if (k == NEWLINE || k == RETURN)
  35. break;
  36. --- 254,259 ----
  37. {
  38. k = (*rl_getc_function) (rl_instream);
  39. ! if (rl_stuff_char (k) == 0)
  40. ! break; /* some problem; no more room */
  41. if (k == NEWLINE || k == RETURN)
  42. break;
  43. ***************
  44. *** 374,378 ****
  45. --- 378,386 ----
  46. }
  47. ibuffer[push_index++] = key;
  48. + #if 0
  49. if (push_index >= ibuffer_len)
  50. + #else
  51. + if (push_index > ibuffer_len)
  52. + #endif
  53. push_index = 0;