summary refs log tree commit diff
path: root/src/jobs.c
diff options
context:
space:
mode:
authorNikolai Merinov <n.merinov@inango-systems.com>2019-04-29 19:13:37 +0500
committerHerbert Xu <herbert@gondor.apana.org.au>2020-01-20 17:52:07 +0800
commitc4f4ee8ecf85834811c252fc1df3892863572bbd (patch)
tree2f377c0f421747e5c8656c636730a824c59de625 /src/jobs.c
parentparser: Fix old-style command substitution here-document crash (diff)
downloaddash-c4f4ee8ecf85834811c252fc1df3892863572bbd.tar.gz
dash-c4f4ee8ecf85834811c252fc1df3892863572bbd.zip
expand: Fix trailing newlines processing in backquote expanding
According to POSIX.1-2008 we should remove newlines only at the end of
the substitution. Newlines-only substitions causes dash to remove
newlines before beggining of the substitution. The following code:

    cat <<END
    1
    $(echo "")
    2
    END

prints "1<newline>2" instead of expected "1<newline><newline>2".

This patch fixes trailing newlines processing in backquote expanding.

Signed-off-by: Nikolai Merinov <n.merinov@inango-systems.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'src/jobs.c')
0 files changed, 0 insertions, 0 deletions
g'> 2018-08-07Hack clang into checking uiFmt format stringsJune McEnroe 2018-08-07Handle PART and QUIT without messagesJune McEnroe 2018-08-07Make safe filling the who bufferJune McEnroe 2018-08-07Add reverse and reset IRC formatting codesJune McEnroe 2018-08-06Rewrite line editing again, add formattingJune McEnroe 2018-08-06Fix allocation size in vaswprintfJune McEnroe This is so embarrassing. It only started crashing once it had strings that were long enough, and then it took me so long to notice this mistake. I was worried I was still doing va_list wrong somehow. 2018-08-06Implement word wrappingJune McEnroe 2018-08-06Use wchar_t strings for all of UIJune McEnroe vaswprintf is a nightmare. 2018-08-06Rename line editing functionsJune McEnroe 2018-08-05Initialize all possible color pairsJune McEnroe This is actually possible with use_default_colors! 2018-08-05Refactor color initializationJune McEnroe 2018-08-05Add ^L redrawJune McEnroe 2018-08-05Use 16 colors if availableJune McEnroe Fall back to using bold if there are only 8 colors. This also allowed bright background colors in 16-color terminals. I must port this system to torus. I'll be able to remove the awful termcap patch hack. 2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe Oh boy that's embarrassing. 2018-08-04Show source link on exitJune McEnroe 2018-08-04Implement line editing, scrollingJune McEnroe Don't really have a way to implement the M-* keys, and currently missing C-w. 2018-08-04Handle /topicJune McEnroe