summary refs log tree commit diff
path: root/src/input.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-01-12 21:02:26 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2006-01-12 21:02:26 +1100
commite5f903b9451c6e6a79eee939fcf6558a0b93cf8e (patch)
tree31614d5cb303ea275d21ad1f9e1e2dada8467c7d /src/input.c
parentRelease 0.5.3. (diff)
downloaddash-e5f903b9451c6e6a79eee939fcf6558a0b93cf8e.tar.gz
dash-e5f903b9451c6e6a79eee939fcf6558a0b93cf8e.zip
[EVAL] Make eval with empty arguments return 0
On Tue, Jan 10, 2006 at 10:56:23AM +0000, Gerrit Pape wrote:
> tags 347232 + patch
> quit
> 
> On Mon, Jan 09, 2006 at 04:29:19PM +0100, Marco Nenciarini wrote:
> > The problem is here:
> > 
> > # Set the kernel 2.6 option only for fresh install
> > test -z "$(GetMenuOpt "kopt" "")" && kopt_2_6="root=$root_device_2_6 ro"
> > 
> > # Extract options for specific kernels
> > eval $(ExtractMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)")
> > 
> > If the first test fails and the eval argument is empty then dash
> > terminate with exitcode 1.
> 
> > This is a simple testcase:
> > tm:~# bash -c "set -e ;/bin/false && : ; eval ''; echo 'END'"; echo $?
> > END
> > 0
> > tm:~# dash -c "set -e ;/bin/false && : ; eval ''; echo 'END'"; echo $?
> > 1
> > 
> > if you insert any command with successfull exit status before the
> > empty eval, all work ok:
> > tm:~# bash -c "set -e ;/bin/false && : ; : ; eval ''; echo 'END'"; echo $?
> > END
> > 0
> > tm:~# dash -c "set -e ;/bin/false && : ; : ; eval ''; echo 'END'"; echo $?
> > END
> > 0
> 
> Yes, I can confirm this is a bug in dash.  The standard says
> 
>  EXIT STATUS
> 
>      If there are no arguments, or only null arguments, eval shall
>      return a zero exit status; otherwise, it shall return the exit
>      status of the command defined by the string of concatenated
>      arguments separated by <space>s.
> 
> Hi Herbert, please see http://bugs.debian.org/347232

Changed evalstring to return the exit status instead of evalskip.  This
allows us to return zero if the string is empty.
Diffstat (limited to 'src/input.c')
0 files changed, 0 insertions, 0 deletions
2019-10-24Unset non-blocking on clientsJune McEnroe I figure I'll actually use POLLOUT on clients so should never have issues. 2019-10-24Intercept client QUITJune McEnroe 2019-10-24Only set NeedCapEnd if unregisteredJune McEnroe 2019-10-24Set client-side origin to irc.invalidJune McEnroe 2019-10-24Factor out client-side origin nameJune McEnroe 2019-10-24Intercept all CAP commands from clientsJune McEnroe 2019-10-24Ignore further CAP ENDJune McEnroe 2019-10-24Implement client CAP for server-timeJune McEnroe 2019-10-24Implement ringWriteJune McEnroe 2019-10-24Make clientFormat publicJune McEnroe 2019-10-24Make serverFormat publicJune McEnroe 2019-10-24Rename some thingsJune McEnroe 2019-10-23Add ISUPPORT draft to STANDARDSJune McEnroe 2019-10-23Track own originJune McEnroe 2019-10-23Track channels and sync ISUPPORTJune McEnroe 2019-10-23Track nick changesJune McEnroe 2019-10-23Rename Command to MessageJune McEnroe 2019-10-23Synchronize state after client registrationJune McEnroe 2019-10-23Send to server if client has no needsJune McEnroe 2019-10-23Implement some amount of client connectionJune McEnroe 2019-10-23Set clients non-blockingJune McEnroe 2019-10-23Clean up state.c and factor out parsingJune McEnroe 2019-10-23Respond to pingsJune McEnroe 2019-10-23Add verbose flagJune McEnroe 2019-10-23Set NOSIGPIPE on server connectionJune McEnroe 2019-10-23Set an initial loop capJune McEnroe 2019-10-23Fix rest parsingJune McEnroe 2019-10-23Add dynamic poll listJune McEnroe 2019-10-23Don't assume commands have targets and handle ERRORJune McEnroe 2019-10-23Clean up state somewhatJune McEnroe 2019-10-23Actually send the buffer...June McEnroe 2019-10-23Add stateJune McEnroe