NetBSD/bin/sh
kre 9572a5c228 PR bin/52640 PR bin/52641
Don't delete jobs from the jobs table merely because they finished,
if they are not the job we are waiting upon.   (bin/52640 part 1)

In a sub-shell environment, don't allow wait to find jobs from the
parent shell that had already exited (before the sub-shell was
created) and return status for them as if they are our children.
(bin/52640 part 2)

Don't have the "jobs" command also be an implicit "wait" command
in non-interactive shells.  (bin/52641)

Use WCONTINUED (when it exists) so we can report on stopped jobs that
"mysteriously" move back to running state without the user issuing
a "bg" command (eg: kill -CONT <pid>)   Previously they would keep
being reported as stopped until they exited.

When a job is detected as having changed status just as we're
issuing a "jobs" command (i.e.: the change occurred between the last
prompt and the jobs command being entered) don't report it twice,
once from the status change, and then again in the jobs command
output.   Once is enough (keep the jobs output, suppress the other).

Apply some sanity to the way jobs_invalid is processed - ignore it
in getjob() instead of just ignoring it most of the time there, and
instead always check it before calling getjob() in situations where
we can handle only children of the current shell.  This allows the
(totally broken) save/clear/restore of jobs_invalid in jobscmd() to
be done away with (previously an error while in the clear state would
have left jobs_invalid incorrectly cleared - shouldn't have mattered
since jobs_invalid => subshell => error causes exit, but better to be safe).

Add/improve the DEBUG more tracing.

XXX pullup -8
2017-10-23 10:52:07 +00:00
..
bltin Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
funcs delete clauses 3,4 2016-02-29 23:50:59 +00:00
USD.doc Reorg docs, part 2: 2014-07-05 19:23:00 +00:00
alias.c PR bin/52348 2017-07-24 12:34:45 +00:00
alias.h Adjust to the new alias text libedit API. 2014-06-18 18:17:30 +00:00
arith_token.c Add support for ++ and -- (pre & post) and ',' to arithmetic. 2017-07-24 13:21:14 +00:00
arith_tokens.h Add support for ++ and -- (pre & post) and ',' to arithmetic. 2017-07-24 13:21:14 +00:00
arithmetic.c Add support for ++ and -- (pre & post) and ',' to arithmetic. 2017-07-24 13:21:14 +00:00
arithmetic.h A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
builtins.def DEBUG mode shell update (changes nothing for shells which are not 2017-05-15 20:00:36 +00:00
cd.c DEBUG only changes. Convert the TRACE() calls in the remaining files 2017-07-05 20:00:27 +00:00
cd.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
error.c PR bin/52348 2017-07-24 12:35:12 +00:00
error.h Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
eval.c DEBUG only changes (non-debug, ie: normal, shell unaffected) 2017-09-29 17:53:57 +00:00
eval.h PR bin/48875 - avoid holding (replaced) file descriptors open when running a 2016-05-09 21:03:10 +00:00
exec.c DEBUG changes: convert DEBUG TRACE() calls to new format. 2017-07-05 19:58:10 +00:00
exec.h A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
expand.c Three fixes and a change to ~ expansions 2017-10-06 21:09:45 +00:00
expand.h A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
histedit.c Now libedit supports embedded mode switch sequence, improve sh 2017-06-28 13:46:06 +00:00
init.h
input.c NFC - DEBUG mode change only - add some sanity to a debug printf format string 2017-08-19 21:13:11 +00:00
input.h Implement PS1, PS2 and PS4 expansions (variable expansions, arithmetic 2017-06-30 23:02:56 +00:00
jobs.c PR bin/52640 PR bin/52641 2017-10-23 10:52:07 +00:00
jobs.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
machdep.h
mail.c If we are going to keep the MAILPATH % hack, then at least do something 2017-06-04 20:28:13 +00:00
mail.h
main.c DEBUG only changes. Convert the TRACE() calls in the remaining files 2017-07-05 20:00:27 +00:00
main.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
Makefile Implement a bunch of new shell environment variables. many mostly useful 2017-06-30 23:05:45 +00:00
memalloc.c Many internal memory management type fixes. 2017-06-17 07:22:12 +00:00
memalloc.h Many internal memory management type fixes. 2017-06-17 07:22:12 +00:00
miscbltin.c Fix inconsistent whitespace 2017-05-13 15:03:34 +00:00
miscbltin.h
mkbuiltins
mkinit.sh General KNF and source code cleanups, avoid scattering the 2016-03-27 14:34:46 +00:00
mknodenames.sh It is amazing what nonsense appears to work sometimes... (all my nonsense too!) 2017-06-19 11:55:07 +00:00
mknodes.sh
mkoptions.sh Make $- list flags in the same order they appear in sh(1) 2017-07-01 06:14:51 +00:00
mktokens Add a comment explaining the ordering reltionship of the tokens 2017-07-26 03:46:54 +00:00
myhistedit.h Now libedit supports embedded mode switch sequence, improve sh 2017-06-28 13:46:06 +00:00
mystring.c Add const. 2013-04-28 17:01:28 +00:00
mystring.h
nodes.c.pat Use C89 function definitions 2012-03-20 18:42:28 +00:00
nodetypes Remove some left over baggage from the LINENO v1 implementation that 2017-06-08 13:12:17 +00:00
option.list Implement the "pipefail" option (same semantics as in other shells) 2017-07-24 14:17:11 +00:00
options.c PR standards/52406 2017-07-24 12:35:37 +00:00
options.h Arrange for set -o and $- output to be sorted, rather than more 2017-05-28 00:38:01 +00:00
output.c Added comma and plus to the "don't need quoting" set. This affects 2017-05-18 13:31:10 +00:00
output.h Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
parser.c Add support for $'...' quoting (based upon C "..." strings, with \ expansions.) 2017-08-21 13:20:49 +00:00
parser.h Add support for $'...' quoting (based upon C "..." strings, with \ expansions.) 2017-08-21 13:20:49 +00:00
redir.c Include redirections in trace output from "set -x" 2017-06-30 23:01:21 +00:00
redir.h Include redirections in trace output from "set -x" 2017-06-30 23:01:21 +00:00
sh.1 Fix typo: s/one or mode/one or more/ 2017-10-15 12:01:43 +00:00
shell.h NFC: DEBUG mode change - add a couple more TRACE macros to allow for 2017-07-26 03:44:43 +00:00
show.c NFC: DEBUG only change - provide an externally visible (to the DEBUG sh 2017-06-30 23:00:40 +00:00
show.h NFC: DEBUG only change - provide an externally visible (to the DEBUG sh 2017-06-30 23:00:40 +00:00
syntax.c Add support for $'...' quoting (based upon C "..." strings, with \ expansions.) 2017-08-21 13:20:49 +00:00
syntax.h Add support for $'...' quoting (based upon C "..." strings, with \ expansions.) 2017-08-21 13:20:49 +00:00
TOUR Fix grammar in couple of sentences. 2016-10-25 13:01:59 +00:00
trap.c DEBUG and white space changes only. Convert TRACE() calls for DEBUg mode 2017-07-05 19:47:11 +00:00
trap.h report the signal that wait was interrupted by, which is not always SIGINT 2015-08-22 12:12:47 +00:00
var.c Fix a bug noticed by Soren Jacobsen running the netbsd-6-0 build.sh which 2017-08-31 05:09:38 +00:00
var.h Implement a bunch of new shell environment variables. many mostly useful 2017-06-30 23:05:45 +00:00
version.h replace with standard copyright :-) 2016-03-31 16:28:23 +00:00