From: Ron Yorston <rmy@frippery.org>
To: dash@vger.kernel.org, dash@mattwhitlock.name
Subject: Re: Bug in Dash's unquoting of backslashes within backquoted strings
Date: Thu, 21 May 2020 22:57:32 +0100 [thread overview]
Message-ID: <5ec6f94c.cf6OsC6v8fwGBIKX%rmy@frippery.org> (raw)
In-Reply-To: <5ec6f4d5.8pMzL3JNioCKa/Fi%rmy@frippery.org>
Ron Yorston wrote:
>This seems to have been introduced by commit 6bbc71d (parser: use
>pgetc_eatbnl() in more places). Reverting the following part of the
>commit makes the problem go away:
>
> case '\\':
>- if ((pc = pgetc()) == '\n') {
>- nlprompt();
>- /*
>- * If eating a newline, avoid putting
>- * the newline into the new character
>- * stream (via the STPUTC after the
>- * switch).
>- */
>- continue;
>- }
>+ pc = pgetc_eatbnl();
Alternatively I see that BusyBox ash did this:
case '\\':
- pc = pgetc();
- if (pc == '\n') {
- nlprompt();
- /*
- * If eating a newline, avoid putting
- * the newline into the new character
- * stream (via the STPUTC after the
- * switch).
- */
- continue;
- }
+ pc = pgetc(); /* or pgetc_eatbnl()? why (example)? */
Ron
next prev parent reply other threads:[~2020-05-21 21:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 20:06 Bug in Dash's unquoting of backslashes within backquoted strings Matt Whitlock
2020-05-21 21:38 ` Ron Yorston
2020-05-21 21:57 ` Ron Yorston [this message]
2020-05-26 13:19 ` parser: Fix double-backslash nl in old-style command sub Herbert Xu
2020-05-21 22:02 ` Bug in Dash's unquoting of backslashes within backquoted strings Harald van Dijk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ec6f94c.cf6OsC6v8fwGBIKX%rmy@frippery.org \
--to=rmy@frippery.org \
--cc=dash@mattwhitlock.name \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).