bash30-003 4.1 KB

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