b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | BASH PATCH REPORT |
| 2 | ================= |
| 3 | |
| 4 | Bash-Release: 5.1 |
| 5 | Patch-ID: bash51-002 |
| 6 | |
| 7 | Bug-Reported-by: oguzismailuysal@gmail.com |
| 8 | Bug-Reference-ID: <CAH7i3LoHFUa4aSF5-AD2r80HG-p-YzD_9ZxomarZkhP8NMq63g@mail.gmail.com> |
| 9 | Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2020-12/msg00037.html |
| 10 | |
| 11 | Bug-Description: |
| 12 | |
| 13 | If there are no jobs, and the `-n' and `-p' options are both supplied to |
| 14 | `wait', bash can assign a value to the variable name specified with `-p' |
| 15 | instead of leaving it unset. |
| 16 | |
| 17 | Patch (apply with `patch -p0'): |
| 18 | |
| 19 | --- a/builtins/wait.def |
| 20 | +++ b/builtins/wait.def |
| 21 | @@ -213,11 +213,11 @@ wait_builtin (list) |
| 22 | } |
| 23 | |
| 24 | status = wait_for_any_job (wflags, &pstat); |
| 25 | - if (status < 0) |
| 26 | - status = 127; |
| 27 | - |
| 28 | if (vname && status >= 0) |
| 29 | bind_var_to_int (vname, pstat.pid); |
| 30 | + |
| 31 | + if (status < 0) |
| 32 | + status = 127; |
| 33 | if (list) |
| 34 | unset_waitlist (); |
| 35 | WAIT_RETURN (status); |
| 36 | --- a/patchlevel.h |
| 37 | +++ b/patchlevel.h |
| 38 | @@ -25,6 +25,6 @@ |
| 39 | regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh |
| 40 | looks for to find the patch level (for the sccs version string). */ |
| 41 | |
| 42 | -#define PATCHLEVEL 1 |
| 43 | +#define PATCHLEVEL 2 |
| 44 | |
| 45 | #endif /* _PATCHLEVEL_H_ */ |