NetBSD/bin/sh
kre 51a7b24283 Fix an ordering error in the previous (and even earlier, going back
a way, but made more serious with the recent changes).

The n>&n operation (more or less a no-op, except it clears CLOEXEC)
should precede almost everything else - and simply be made to fail if
an attempt is made to apply it to a sh internal fd.

We were renumbering the internal fd (the n> part considered first)
which was dumb, but OK, before, but now rejecting the operation
(the >&n) part when n should not be visible to the script.  That
made something of a mess (and could lead to the shell believing its
job control tty was at a fd it never got moved to).

Do things in the correct order, and simply fail that case for internal
fds (for every other n>xxx for any xxx sh simply renumbers its internal fd
n to some other fd before attempting the operation, even n>&- ... those are
all fine).

[In all the above the '>' is used in place of any redirect operator].
2021-09-15 20:21:47 +00:00
..
USD.doc Fix "every" typo in quote from The Mythical Man-Month 2018-09-14 05:59:10 +00:00
bltin Fix a bug in the built-in echo in /bin/sh reported in private mail by 2021-05-18 21:39:06 +00:00
funcs
Makefile Add -I to find filecomplete.h 2021-08-15 11:57:17 +00:00
TOUR
alias.c Allocate alias pointers for qsort() to use on the stack, rather than 2019-02-09 09:11:07 +00:00
alias.h Revamp aliases - as dumb an idea as they are, if we're going 2018-12-03 06:40:26 +00:00
arith_token.c
arith_tokens.h
arithmetic.c
arithmetic.h
builtins.def Add the "specialvar" built-in command. Discussed (well, mentioned 2019-02-14 11:15:24 +00:00
cd.c
cd.h
error.c PR bin/53919 2019-02-04 11:16:41 +00:00
error.h PR bin/53919 2019-02-04 11:16:41 +00:00
eval.c Related to PR bin/48875 2021-04-04 13:24:07 +00:00
eval.h PR bin/53919 2019-02-04 11:16:41 +00:00
exec.c PR bin/55979 2021-02-16 15:30:12 +00:00
exec.h Deal with ref after free found by ASAN when a function redefines 2018-06-22 11:04:55 +00:00
expand.c bin: remove unnecessary lint comment CONSTCOND 2021-09-10 22:11:03 +00:00
expand.h When expanding a here-doc (NXHERE - the type with an unquoted end delim) 2020-02-13 05:19:05 +00:00
histedit.c Quote the filenames like before 2021-09-14 15:04:09 +00:00
init.h
input.c PR bin/55979 2021-02-16 15:30:26 +00:00
input.h PR bin/48875 (is related, and ameliorated, but not exactly "fixed") 2018-08-19 23:50:27 +00:00
jobs.c Don't dereference NULL on "jobs -Z" (with no title given), instead 2021-09-12 01:30:41 +00:00
jobs.h Add jobs -Z (like in zsh(1)) to setproctitle(3). 2021-09-11 20:43:32 +00:00
machdep.h
mail.c
mail.h
main.c Improve the solution for the 2nd access to a fd which shouldn't 2021-09-15 18:29:45 +00:00
main.h When forking a child shell, arrange for errors/exit to always unwind 2018-12-03 02:38:30 +00:00
memalloc.c INTON / INTOFF audit and cleanup. 2019-02-09 03:35:55 +00:00
memalloc.h Fix (hopefully) the problem reported on current-users by Patrick Welche. 2018-08-22 20:08:54 +00:00
miscbltin.c Have the ulimit command watch for ulimit -n (alter number of available fds) 2021-09-15 18:30:57 +00:00
miscbltin.h
mkbuiltins
mkinit.sh Use printf, rather than echo (via echo redefined as a function that 2018-12-05 09:20:18 +00:00
mknodenames.sh In the older debug code (not using the new macros added in the 2018-08-18 03:09:37 +00:00
mknodes.sh Add some error checking, and stop assuming what the input 2019-01-19 13:08:50 +00:00
mkoptions.sh
mktokens
myhistedit.h - Add command completion (from FreeBSD) 2021-08-15 10:17:55 +00:00
mystring.c Remove atoi() 2018-07-13 22:43:44 +00:00
mystring.h
nodes.c.pat Deal with ref after free found by ASAN when a function redefines 2018-06-22 11:04:55 +00:00
nodetypes
option.list Avoid long option names that differ only in character case. 2018-11-23 20:40:06 +00:00
options.c Oops, the previous didn't do what was promised. Rather that ignoring 2020-02-05 14:56:25 +00:00
options.h
output.c
output.h
parser.c Improve the solution for the 2nd access to a fd which shouldn't 2021-09-15 18:29:45 +00:00
parser.h Delete a no-longer-used #define that referred to a struct field that 2019-02-13 21:40:50 +00:00
redir.c Fix an ordering error in the previous (and even earlier, going back 2021-09-15 20:21:47 +00:00
redir.h Improve the solution for the 2nd access to a fd which shouldn't 2021-09-15 18:29:45 +00:00
sh.1 Have the ulimit command watch for ulimit -n (alter number of available fds) 2021-09-15 18:30:57 +00:00
shell.h bin: remove unnecessary lint comment CONSTCOND 2021-09-10 22:11:03 +00:00
show.c bin: remove unnecessary lint comment CONSTCOND 2021-09-10 22:11:03 +00:00
show.h
syntax.c Add a couple of comments. NFC. 2019-02-04 09:56:48 +00:00
syntax.h Finish the fixes from Feb 4 for handling of random data that 2019-02-27 04:10:56 +00:00
trap.c Be less conservative about when we do clear_traps() when we have 2020-08-20 23:09:56 +00:00
trap.h Make pendingsigs forward declaration match the definition. 2018-12-03 10:53:29 +00:00
var.c Fix the fix to a typo in one of the comments. 2021-08-09 11:29:30 +00:00
var.h Alter a design botch when magic (self modifying) variables 2018-12-04 14:03:30 +00:00
version.h The time has come, the Walrus said... (but no shoes, 2018-12-12 12:16:42 +00:00