summary refs log tree commit diff
path: root/src/main.c (follow)
Commit message (Collapse)AuthorAge
* [BUILTIN] Dotcmd should exit with zero when doing nothingJonathan Nieder2011-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Tim Allen wrote: > The POSIX specification for the dot command[1] states: > > EXIT STATUS > Returns the value of the last command executed, or a zero exit > status if no command is executed. > > If an empty file is sourced, then "no command is executed" I agree. Looking through "git log --patch src/main.c", though, I find v0.5.3~42 (Do not clobber exit status in dotcmd., 2005-03-03), which appears to have been meant to take care of the following case: $ cat printstatus.sh echo $? $ false $ . ./printstatus.sh 1 I wonder if the following on top might help (imitating evalcmd)? Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> 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>
* [EVAL] Revert SKIPEVAL into EXEXITHerbert Xu2009-08-11
| | | | | | | Now that eval handles EV_TESTED correctly, we can remove the SKIPEVAL hack and simply use EXEXIT for set -e. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [OPTIONS] Added support for -lHerbert Xu2008-07-13
| | | | | | | This patch adds support for the -l option (login shell) as required by the LSB. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* [SHELL] Expand ENV before using itHerbert Xu2008-07-13
| | | | | | Per POSIX ENV needs to undergo parameter expansion. 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.
* Added eflag fixes for trap and minusc.herbert2005-09-26
| | | | | | Let evaltree handle traps from cmdloop. Reset evalskip after minusc is executed. Stop executing traps once SKIPEVAL is seen.
* Let evaltree handle traps from cmdloop.herbert2005-09-26
|
* Handle SKIPEVAL in read_profile by exiting.herbert2005-09-26
|
* Generalise setinputfile for use in read_profile/readcmdfile.herbert2005-09-26
|
* Do not clobber exit status in dotcmd.herbert2005-09-26
|
* Removed redundant setstackmark from dotcmd.herbert2005-09-26
|
* Removed qflag.herbert2005-09-26
|
* Renamed error to sh_error.herbert2005-09-26
|
* Replaced EXEVAL with SKIPEVAL.herbert2005-09-26
|
* Optimise away status and case statement in main().herbert2005-09-26
|
* Eliminated global exerrno.herbert2005-09-26
|
* Size optimisations with state/s in main().herbert2005-09-26
|
* Catch set -e exits within built-in commands.herbert2005-09-26
|
* Changed boolean rootshell into shlvl counter.herbert2005-09-26
|
* Initial import.Herbert Xu2005-09-26