summary refs log tree commit diff
path: root/src/options.h
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/options.h
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 '')
0 files changed, 0 insertions, 0 deletions
bd96050e5cbd67c9d943bae31&follow=1'>Call uiShow at init so that TermFocus gets setJune McEnroe 2018-12-03Check nick to determine if is selfJune McEnroe 2018-12-03Ignore ~ username prefixesJune McEnroe 2018-12-02Move host, port, pass, webp to selfJune McEnroe 2018-12-02Add -r option for realnameJune McEnroe 2018-12-02Send automated messages to TagStatus with UIColdJune McEnroe 2018-12-02Various man page tweaks and editsJune McEnroe 2018-12-02Fix UI resume on /urlJune McEnroe 2018-12-02Add sandman.m to READMEJune McEnroe 2018-12-01Crudely handle reconnecting after suspendJune McEnroe 2018-12-01Fix sandman hangJune McEnroe 2018-12-01Use sigaction in sandmanJune McEnroe 2018-11-30Handle signals consistently in the event loopJune McEnroe 2018-11-30Separate ircConnect and ircDisconnectJune McEnroe 2018-11-30Measure length of log timestamp more consistentlyJune McEnroe 2018-11-30Reformat sandman Objective-C codeJune McEnroe 2018-11-30Ignore sandmanJune McEnroe 2018-11-30Add sandmanJune McEnroe 2018-11-29Strip timestamps from log replayJune McEnroe 2018-11-29Add basic log replayJune McEnroe 2018-11-29Show unread count in term titleJune McEnroe 2018-11-29Handle no such nick errorJune McEnroe 2018-11-29Add /whoisJune McEnroe 2018-11-29Set LIBRESSL_PREFIX in Darwin.mkJune McEnroe 2018-11-28Add NetBSD.mkJune McEnroe 2018-11-28Make use of config.mk and add Darwin.mkJune McEnroe