summary refs log tree commit diff
path: root/src/error.c (follow)
Commit message (Collapse)AuthorAge
* [ERROR] Set exitstatus in onintHerbert Xu2014-10-02
| | | | | | | | | | | | Currently the exit status when we receive SIGINT is set in evalcommand which means that it doesn't always get set. For example, if you press CTRL-C at the prompt of an interactive dash, the exit status is not set to 130 as it is in many other Bourne shells. This patch fixes this by moving the setting of the exit status into onint which also simplifies evalcommand. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [DEBUG] Use va_copy when reusing a va_listJonathan Nieder2011-03-15
| | | | | | | | | | | | | | | | | When tracing (with the DEBUG compile-time option set to 1 or 2), exverror calls TRACEV to print its arguments before passing them on. So the arguments are consumed by the time exvwarning looks for them, resulting in a segfault: $ sh -c '"' sh: Syntax error: Unterminated quoted string $ sh -o debug -c '"' sh: Segmentation fault (core dumped) Make a copy with va_copy to avoid this. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [SHELL] Improve LINENO supportHarald van Dijk2011-03-15
| | | | | | | | | | | | 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>
* [ERROR] Allow the originator of EXERROR to set the exit statusHerbert Xu2010-11-28
| | | | | | | | Some errors have exit status values specified by POSIX and it is therefore desirable to be able to set the exit status at the EXERROR source rather than in main.c. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [SIGNAL] Remove EXSIGHerbert Xu2009-02-22
| | | | | | Now that waitcmd no longer uses EXSIG we can remove it. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [ERROR] Set default exvwarning2 arg0 for errors during early initialisationHerbert Xu2008-05-03
| | | | | | | | As it stands if we get an error before procargs gets called by main() we'll try to print out a null pointer. This patch avoids this by printing out "sh" instead. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* Copyright/licence updates and remove all traces of sys/cdefs.hHerbert Xu2005-10-29
| | | | | | | | | | | This change updates the BSD licence to the three-clause version since NetBSD has already done so. This makes dash GPL-compatible. It also adds Christos Zoulas (NetBSD ash maintainer) to the COPYING file. I've added "copyright by Herbert Xu" to most files. Finally all CVS IDs and inclusion of sys/cdefs.h have been removed. The latter is needed for support of klibc.
* Renamed error to sh_error.herbert2005-09-26
|
* Initial import.Herbert Xu2005-09-26