NetBSD/bin/sh
kre 727a69dc1d A better LINENO implementation. This version deletes (well, #if 0's out)
the LINENO hack, and uses the LINENO var for both ${LINENO} and $((LINENO)).
(Code to invert the LINENO hack when required, like when de-compiling the
execution tree to provide the "jobs" command strings, is still included,
that can be deleted when the LINENO hack is completely removed - look for
refs to VSLINENO throughout the code.  The var funclinno in parser.c can
also be removed, it is used only for the LINENO hack.)

This version produces accurate results: $((LINENO)) was made as accurate
as the LINENO hack made ${LINENO} which is very good.  That's why the
LINENO hack is not yet completely removed, so it can be easily re-enabled.
If you can tell the difference when it is in use, or not in use, then
something has broken (or I managed to miss a case somewhere.)

The way that LINENO works is documented in its own (new) section in the
man page, so nothing more about that, or the new options, etc, here.

This version introduces the possibility of having a "reference" function
associated with a variable, which gets called whenever the value of the
variable is required (that's what implements LINENO).  There is just
one function pointer however, so any particular variable gets at most
one of the set function (as used for PATH, etc) or the reference function.
The VFUNCREF bit in the var flags indicates which func the variable in
question uses (if any - the func ptr, as before, can be NULL).

I would not call the results of this perfect yet, but it is close.
2017-06-07 05:08:32 +00:00
..
bltin Avoid warning by using gcc'ism 2016-03-16 22:36:21 +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 Adjust to the new alias text libedit API. 2014-06-18 18:17:30 +00:00
alias.h Adjust to the new alias text libedit API. 2014-06-18 18:17:30 +00:00
arith_token.c A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
arith_tokens.h A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
arithmetic.c A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +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 Make cd (really) do cd -P, and not just claim that is what it is doing 2017-06-04 20:27:14 +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/47065 PR bin/39466 2016-06-01 02:50:02 +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 A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +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 A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +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 A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +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 Sprinkle volatile for gcc 5! 2016-03-16 22:36:40 +00:00
init.h
input.c A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
input.h An initial attempt at implementing LINENO to meet the specs. 2017-06-07 04:44:17 +00:00
jobs.c A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +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 More DEBUG mode changes. As usual, read the source if you care. 2017-05-29 14:03:23 +00:00
main.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
Makefile More DEBUG mode changes. As usual, read the source if you care. 2017-05-29 14:03:23 +00:00
memalloc.c Fix inconsistent definitions 2008-02-15 17:26:06 +00:00
memalloc.h Fixes to shell expand (that is, $ stuff) from FreeBSD (implemented 2017-06-03 10:31:16 +00:00
miscbltin.c Fix inconsistent whitespace 2017-05-13 15:03:34 +00:00
miscbltin.h
mkbuiltins Make this slightly more portable; it has to run on arbitary host 2009-10-06 19:56:58 +00:00
mkinit.sh General KNF and source code cleanups, avoid scattering the 2016-03-27 14:34:46 +00:00
mknodenames.sh General KNF and source code cleanups, avoid scattering the 2016-03-27 14:34:46 +00:00
mknodes.sh Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
mkoptions.sh Redo mkoptions.sh .. much better this way, now fully automated 2017-05-28 14:14:22 +00:00
mktokens Implement the ';&' (used instead of ';;') case statement list terminator 2017-05-04 04:37:51 +00:00
myhistedit.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +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 A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
option.list A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
options.c More DEBUG mode changes. As usual, read the source if you care. 2017-05-29 14:03:23 +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 A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
parser.h A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
redir.c Now that the shell is protecting its internal fds properly, moving 2017-05-29 22:21:00 +00:00
redir.h Keep track of which file descriptors the shell is using for its 2017-04-29 15:14:28 +00:00
sh.1 A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
shell.h More DEBUG mode changes. As usual, read the source if you care. 2017-05-29 14:03:23 +00:00
show.c A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
show.h The beginnings of the great shell DEBUG (tracing) upgrade of 2017... 2017-05-13 03:26:03 +00:00
syntax.c A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
syntax.h A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
TOUR Fix grammar in couple of sentences. 2016-10-25 13:01:59 +00:00
trap.c Enhance the trap command to make it possible to do what POSIX wants 2017-05-07 15:01:18 +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 A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
var.h A better LINENO implementation. This version deletes (well, #if 0's out) 2017-06-07 05:08:32 +00:00
version.h replace with standard copyright :-) 2016-03-31 16:28:23 +00:00