On Wed, Oct 12, 2016 at 07:24:26PM +0200, Harald van Dijk wrote:
>
> > I would have expected another exception to be in alias expansions that
> > end in a backslash. Shells are not entirely in agreement there, but most
> > appear to treat this the regular way, meaning
> >
> > dash -c 'alias bs=\\
> > bs
> > '
> >
> > prints nothing.
I think your patch changes this. In order to preserve the existing
behaviour (which seems logical), you should change the second pgetc
call in pgetc_eatbnl to pgetc2.
> With more extensive testing, the only issue I've seen is what Jilles
> Tjoelker had already mentioned, namely that backslash-newline should be
> preserved inside single-quoted strings, and also that it should be
> preserved inside heredocs where any part of the delimiter is quoted:
>
> cat <<\EOF
> \
> EOF
>
> dash's parsing treats this mostly the same as a single-quoted string,
> and the same extra check handles both cases.
>
> Here's an updated patch. Hoping this looks okay and can be applied.
I'm fine with the concept. However, your patch also breaks here-
document parsing when the delimiter is a single backslash.
cat << "\"
\
If you can fix these two problems it should be good to go.
Cheers,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html