[packages] bash: import upstream 4.2 patch series
[packages.git] / utils / bash / patches / 118-upstream-bash42-018.patch
1                              BASH PATCH REPORT
2                              =================
3
4 Bash-Release:   4.2
5 Patch-ID:       bash42-018
6
7 Bug-Reported-by:        Thomas Cort <tcort@minix3.org>
8 Bug-Reference-ID:       <BANLkTik-ebGGw3k_1YtB=RyfV1bsqdxC_g@mail.gmail.com>
9 Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2011-06/msg00110.html
10
11 Bug-Description:
12
13 Bash fails to compile unless JOB_CONTROL is defined.
14
15 Patch (apply with `patch -p0'):
16
17 --- a/execute_cmd.c
18 +++ b/execute_cmd.c
19 @@ -2196,6 +2196,7 @@ execute_pipeline (command, asynchronous,
20    if (ignore_return && cmd)
21      cmd->flags |= CMD_IGNORE_RETURN;
22  
23 +#if defined (JOB_CONTROL)
24    lastpipe_flag = 0;
25    begin_unwind_frame ("lastpipe-exec");
26    lstdin = -1;
27 @@ -2219,15 +2220,19 @@ execute_pipeline (command, asynchronous,
28           lastpipe_jid = stop_pipeline (0, (COMMAND *)NULL);    /* XXX */
29           add_unwind_protect (lastpipe_cleanup, lastpipe_jid);
30         }
31 -      cmd->flags |= CMD_LASTPIPE;
32 +      if (cmd)
33 +       cmd->flags |= CMD_LASTPIPE;
34      }    
35    if (prev >= 0)
36      add_unwind_protect (close, prev);
37 +#endif
38  
39    exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close);
40  
41 +#if defined (JOB_CONTROL)
42    if (lstdin > 0)
43      restore_stdin (lstdin);
44 +#endif
45  
46    if (prev >= 0)
47      close (prev);
48 --- a/patchlevel.h
49 +++ b/patchlevel.h
50 @@ -25,6 +25,6 @@
51     regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
52     looks for to find the patch level (for the sccs version string). */
53  
54 -#define PATCHLEVEL 17
55 +#define PATCHLEVEL 18
56  
57  #endif /* _PATCHLEVEL_H_ */