bash30-003 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.0
  4. Patch-ID: bash30-003
  5. Bug-Reported-by: Egmont Koblinger <egmont@uhulinux.hu>
  6. Bug-Reference-ID: <Pine.LNX.4.58L0.0407290044500.12603@sziami.cs.bme.hu>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2004-07/msg00279.html
  8. Bug-Description:
  9. Bash no longer accepts the `trap signum' syntax when in POSIX mode. This
  10. patch restores a measure of backwards compatibility.
  11. Patch:
  12. *** ../bash-3.0/builtins/trap.def Thu May 27 22:26:19 2004
  13. --- builtins/trap.def Thu Aug 5 08:55:43 2004
  14. ***************
  15. *** 24,28 ****
  16. $BUILTIN trap
  17. $FUNCTION trap_builtin
  18. ! $SHORT_DOC trap [-lp] [[arg] signal_spec ...]
  19. The command ARG is to be read and executed when the shell receives
  20. signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC
  21. --- 24,28 ----
  22. $BUILTIN trap
  23. $FUNCTION trap_builtin
  24. ! $SHORT_DOC trap [-lp] [arg signal_spec ...]
  25. The command ARG is to be read and executed when the shell receives
  26. signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC
  27. ***************
  28. *** 88,92 ****
  29. WORD_LIST *list;
  30. {
  31. ! int list_signal_names, display, result, opt;
  32. list_signal_names = display = 0;
  33. --- 88,92 ----
  34. WORD_LIST *list;
  35. {
  36. ! int list_signal_names, display, result, opt, first_signal;
  37. list_signal_names = display = 0;
  38. ***************
  39. *** 119,130 ****
  40. {
  41. char *first_arg;
  42. ! int operation, sig;
  43. operation = SET;
  44. first_arg = list->word->word;
  45. /* When in posix mode, the historical behavior of looking for a
  46. missing first argument is disabled. To revert to the original
  47. signal handling disposition, use `-' as the first argument. */
  48. ! if (posixly_correct == 0 && first_arg && *first_arg &&
  49. (*first_arg != '-' || first_arg[1]) &&
  50. signal_object_p (first_arg, opt) && list->next == 0)
  51. --- 119,135 ----
  52. {
  53. char *first_arg;
  54. ! int operation, sig, first_signal;
  55. operation = SET;
  56. first_arg = list->word->word;
  57. + first_signal = first_arg && *first_arg && all_digits (first_arg) && signal_object_p (first_arg, opt);
  58. +
  59. + /* Backwards compatibility */
  60. + if (first_signal)
  61. + operation = REVERT;
  62. /* When in posix mode, the historical behavior of looking for a
  63. missing first argument is disabled. To revert to the original
  64. signal handling disposition, use `-' as the first argument. */
  65. ! else if (posixly_correct == 0 && first_arg && *first_arg &&
  66. (*first_arg != '-' || first_arg[1]) &&
  67. signal_object_p (first_arg, opt) && list->next == 0)
  68. *** ../bash-3.0/doc/bashref.texi Sat Jun 26 14:26:07 2004
  69. --- doc/bashref.texi Fri Aug 27 12:33:46 2004
  70. ***************
  71. *** 5954,5958 ****
  72. The @code{trap} builtin doesn't check the first argument for a possible
  73. signal specification and revert the signal handling to the original
  74. ! disposition if it is. If users want to reset the handler for a given
  75. signal to the original disposition, they should use @samp{-} as the
  76. first argument.
  77. --- 5967,5972 ----
  78. The @code{trap} builtin doesn't check the first argument for a possible
  79. signal specification and revert the signal handling to the original
  80. ! disposition if it is, unless that argument consists solely of digits and
  81. ! is a valid signal number. If users want to reset the handler for a given
  82. signal to the original disposition, they should use @samp{-} as the
  83. first argument.
  84. *** ../bash-3.0/patchlevel.h Wed Aug 22 08:05:39 2001
  85. --- patchlevel.h Thu Sep 2 15:04:32 2004
  86. ***************
  87. *** 26,30 ****
  88. looks for to find the patch level (for the sccs version string). */
  89. ! #define PATCHLEVEL 2
  90. #endif /* _PATCHLEVEL_H_ */
  91. --- 26,30 ----
  92. looks for to find the patch level (for the sccs version string). */
  93. ! #define PATCHLEVEL 3
  94. #endif /* _PATCHLEVEL_H_ */
  95. *** ../bash-3.0/tests/errors.right Thu May 27 22:26:03 2004
  96. --- tests/errors.right Sat Aug 7 22:35:10 2004
  97. ***************
  98. *** 86,90 ****
  99. ./errors.tests: line 216: trap: NOSIG: invalid signal specification
  100. ./errors.tests: line 219: trap: -s: invalid option
  101. ! trap: usage: trap [-lp] [[arg] signal_spec ...]
  102. ./errors.tests: line 225: return: can only `return' from a function or sourced script
  103. ./errors.tests: line 229: break: 0: loop count out of range
  104. --- 86,90 ----
  105. ./errors.tests: line 216: trap: NOSIG: invalid signal specification
  106. ./errors.tests: line 219: trap: -s: invalid option
  107. ! trap: usage: trap [-lp] [arg signal_spec ...]
  108. ./errors.tests: line 225: return: can only `return' from a function or sourced script
  109. ./errors.tests: line 229: break: 0: loop count out of range