summary refs log tree commit diff
path: root/src/expand.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-03-10 21:23:11 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2011-03-10 21:23:11 +0800
commit8213431d222b56316e225a1f308b62a72fbb1faa (patch)
tree303808ccc3ab85a23f38a4920228fd35f794d6da /src/expand.c
parent[BUILTIN] Fix CTLESC clobbering by read(1) (diff)
downloaddash-8213431d222b56316e225a1f308b62a72fbb1faa.tar.gz
dash-8213431d222b56316e225a1f308b62a72fbb1faa.zip
[BUILTIN] Dotcmd should exit with zero when doing nothing
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>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
6a14ea7801&follow=1'>Match Tag in RustJune McEnroe 2019-02-18Match sh functions as TagJune McEnroe 2019-02-18Match Sh and Ss as Tag in mdocJune McEnroe 2019-02-18Match statics and typedefs as TagJune McEnroe 2019-02-18Clean up htmlHeaderJune McEnroe 2019-02-18Remove hi line numberingJune McEnroe Tags are much better for referring to specific parts of a file and line numbering is better done by a post-processing tool such as cat -n or producing a two-column HTML <table>. 2019-02-18Add Tag class to hiJune McEnroe 2019-02-17Generate HTML with hi -n -f html -o anchorJune McEnroe Running hi twice to insert stuff between the head and the content is a bit of a hack but oh well. 2019-02-17Add hi -f html -o anchor for line number linksJune McEnroe 2019-02-17Simplify temp trap in upJune McEnroe 2019-02-17Add line numbers to hiJune McEnroe Renames previous -n option to -m to stay consistent with cat -n. Prefixing lines with line numbers affects where the first tab indent ends up relative to the text above it. Not sure if it's worth fixing somehow. 2019-02-17Always split spans after newlinesJune McEnroe Simplifies ANSI and IRC output code, and prepares for line numbered output. 2019-02-15Color format specifiers light cyan in vimJune McEnroe 2019-02-15Highlight Interp as yellowJune McEnroe 2019-02-15Highlight strings in sh command substitutionsJune McEnroe 2019-02-15Add nmap gpJune McEnroe 2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe 2019-02-13Add forgotten "sixth" book of H2G2June McEnroe