Re: dash tested against ash testsuite: 17 failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10-10-16 23:51, Jilles Tjoelker wrote:
On Sat, Oct 08, 2016 at 09:42:12PM +0200, Martijn Dekker wrote:
Op 01-10-16 om 19:17 schreef Denys Vlasenko:
ash-vars/var_unbackslash.tests

ITYM ash-vars/var_unbackslash1.tests

    echo Forty two:$\
    (\
    (\
    42\
    )\
    )
    dash says: Syntax error: Missing '))'

Yes, but it's not clear to me that it shouldn't.

Hmm... maybe this is indeed a bug:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_01
"A <backslash> that is not quoted shall preserve the literal value of
the following character, with the exception of a <newline>. If a
<newline> follows the <backslash>, the shell shall interpret this as
line continuation. The <backslash> and <newline> shall be removed before
splitting the input into tokens. Since the escaped <newline> is removed
entirely from the input and is not replaced by any white space, it
cannot serve as a token separator."

So, unless I'm misreading this, it looks like backslashes need to be
parsed before *any* other kind of lexical analysis.

Yes, for <backslash><newline> sequences that are not quoted.

For example, <single-quote><backslash><newline><single-quote> contains
two characters between the quotes, not zero.

Ah, right, I missed that exception. Note that it only applies to single-quoted strings. In double-quoted strings, backslash-newline should be removed just as when unquoted.

Cheers,
Harald van Dijk
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux