diff options
author | Harald van Dijk <harald@gigawatt.nl> | 2011-03-15 15:52:05 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-03-15 15:52:05 +0800 |
commit | 5bb39bb1995cb12d8da76b1d482df9be1acc2eb4 (patch) | |
tree | 09c088a97971babd2e0dd593d7601e282ed5fc69 /src/input.c | |
parent | [EVAL] Let funcnode refer to a function definition, not its first command (diff) | |
download | dash-5bb39bb1995cb12d8da76b1d482df9be1acc2eb4.tar.gz dash-5bb39bb1995cb12d8da76b1d482df9be1acc2eb4.zip |
[SHELL] Improve LINENO support
This patch improves LINENO support by storing line numbers in the parse tree, for commands as well as for function definitions. It makes LINENO behaves properly when calling functions, and has the added benefit of improved line numbers in error messages when the last-parsed command is not the last-executed one. It removes the earlier LINENO support, and instead sets LINENO from evaltree when a command is executed Signed-off-by: Harald van Dijk <harald@gigawatt.nl> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | src/input.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/input.c b/src/input.c index bd3a9a2..d31c45b 100644 --- a/src/input.c +++ b/src/input.c @@ -54,7 +54,6 @@ #include "alias.h" #include "parser.h" #include "main.h" -#include "var.h" #ifndef SMALL #include "myhistedit.h" #endif @@ -531,12 +530,3 @@ closescript(void) parsefile->fd = 0; } } - - -int lineno_inc(void) -{ - int lineno = plinno++; - - setvarint("LINENO", lineno, 0); - return lineno; -} |