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