bash32-022 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.2
  4. Patch-ID: bash32-022
  5. Bug-Reported-by: Chet Ramey <chet.ramey@cwru.edu>
  6. Bug-Reference-ID:
  7. Bug-Reference-URL:
  8. Bug-Description:
  9. POSIX specifies that the `read' builtin invoked from an interative shell
  10. must prompt with $PS2 when a line is continued using a backslash while
  11. reading from a terminal.
  12. Patch:
  13. *** ../bash-3.2-patched/builtins/read.def Tue Sep 19 08:45:48 2006
  14. --- bash-3.2/builtins/read.def Thu May 24 16:03:30 2007
  15. ***************
  16. *** 128,133 ****
  17. {
  18. register char *varname;
  19. ! int size, i, nr, pass_next, saw_escape, eof, opt, retval, code;
  20. ! int input_is_tty, input_is_pipe, unbuffered_read;
  21. int raw, edit, nchars, silent, have_timeout, fd;
  22. unsigned int tmout;
  23. --- 131,136 ----
  24. {
  25. register char *varname;
  26. ! int size, i, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2;
  27. ! int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul;
  28. int raw, edit, nchars, silent, have_timeout, fd;
  29. unsigned int tmout;
  30. ***************
  31. *** 135,139 ****
  32. char c;
  33. char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname;
  34. ! char *e, *t, *t1;
  35. struct stat tsb;
  36. SHELL_VAR *var;
  37. --- 138,142 ----
  38. char c;
  39. char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname;
  40. ! char *e, *t, *t1, *ps2;
  41. struct stat tsb;
  42. SHELL_VAR *var;
  43. ***************
  44. *** 149,152 ****
  45. --- 152,156 ----
  46. USE_VAR(i);
  47. USE_VAR(pass_next);
  48. + USE_VAR(print_ps2);
  49. USE_VAR(saw_escape);
  50. USE_VAR(input_is_pipe);
  51. ***************
  52. *** 164,167 ****
  53. --- 168,172 ----
  54. #endif
  55. USE_VAR(list);
  56. + USE_VAR(ps2);
  57. i = 0; /* Index into the string that we are reading. */
  58. ***************
  59. *** 387,391 ****
  60. #endif
  61. ! for (eof = retval = 0;;)
  62. {
  63. #if defined (READLINE)
  64. --- 394,399 ----
  65. #endif
  66. ! ps2 = 0;
  67. ! for (print_ps2 = eof = retval = 0;;)
  68. {
  69. #if defined (READLINE)
  70. ***************
  71. *** 413,416 ****
  72. --- 421,433 ----
  73. #endif
  74. + if (print_ps2)
  75. + {
  76. + if (ps2 == 0)
  77. + ps2 = get_string_value ("PS2");
  78. + fprintf (stderr, "%s", ps2 ? ps2 : "");
  79. + fflush (stderr);
  80. + print_ps2 = 0;
  81. + }
  82. +
  83. if (unbuffered_read)
  84. retval = zread (fd, &c, 1);
  85. ***************
  86. *** 441,445 ****
  87. pass_next = 0;
  88. if (c == '\n')
  89. ! i--; /* back up over the CTLESC */
  90. else
  91. goto add_char;
  92. --- 458,466 ----
  93. pass_next = 0;
  94. if (c == '\n')
  95. ! {
  96. ! i--; /* back up over the CTLESC */
  97. ! if (interactive && input_is_tty && raw == 0)
  98. ! print_ps2 = 1;
  99. ! }
  100. else
  101. goto add_char;
  102. *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
  103. --- bash-3.2/patchlevel.h Mon Oct 16 14:22:54 2006
  104. ***************
  105. *** 26,30 ****
  106. looks for to find the patch level (for the sccs version string). */
  107. ! #define PATCHLEVEL 21
  108. #endif /* _PATCHLEVEL_H_ */
  109. --- 26,30 ----
  110. looks for to find the patch level (for the sccs version string). */
  111. ! #define PATCHLEVEL 22
  112. #endif /* _PATCHLEVEL_H_ */