7 Bug-Reported-by: Brian J. Murrell" <brian@interlinx.bc.ca>
8 Bug-Reference-ID: <1237564627.7666.12.camel@pc.interlinx.bc.ca>
9 Bug-Reference-URL:http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00160.html
13 There are several problems with the handling of $LINENO in an ERR trap.
17 *** ../bash-4.0-patched/trap.c 2009-01-16 17:07:53.000000000 -0500
18 --- trap.c 2009-03-20 21:37:00.000000000 -0400
22 flags = SEVAL_NONINT|SEVAL_NOHIST;
23 ! if (sig != DEBUG_TRAP && sig != RETURN_TRAP)
24 flags |= SEVAL_RESETLINE;
25 if (function_code == 0)
28 flags = SEVAL_NONINT|SEVAL_NOHIST;
29 ! if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP)
30 flags |= SEVAL_RESETLINE;
31 if (function_code == 0)
32 *** ../bash-4.0-patched/execute_cmd.c 2009-02-13 16:41:41.000000000 -0500
33 --- execute_cmd.c 2009-03-21 14:16:11.000000000 -0400
37 /* Fork a subshell, turn off the subshell bit, turn off job
38 control and call execute_command () on the command again. */
39 + line_number_for_err_trap = line_number;
40 paren_pid = make_child (savestring (make_command_string (command)),
46 last_command_exit_value = exec_result;
47 + save_line_number = line_number;
48 + line_number = line_number_for_err_trap;
50 + line_number = save_line_number;
57 last_command_exit_value = exec_result;
58 + line_number = line_number_for_err_trap;
60 + line_number = save_line_number;
67 int ignore_return, exec_result, was_error_trap, invert;
68 + volatile int save_line_number;
70 ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
74 ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
76 + line_number_for_err_trap = line_number;
77 exec_result = execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close);
83 last_command_exit_value = exec_result;
84 + save_line_number = line_number;
85 + line_number = line_number_for_err_trap;
87 + line_number = save_line_number;
90 *** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500
91 --- patchlevel.h 2009-02-22 16:11:31.000000000 -0500
94 looks for to find the patch level (for the sccs version string). */
96 ! #define PATCHLEVEL 15
98 #endif /* _PATCHLEVEL_H_ */
100 looks for to find the patch level (for the sccs version string). */
102 ! #define PATCHLEVEL 16
104 #endif /* _PATCHLEVEL_H_ */