ash: parser: Fix parsing of ${}
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 5 Aug 2018 13:58:13 +0000 (15:58 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 5 Aug 2018 16:11:15 +0000 (18:11 +0200)
commit58eb805c2c453c6764acbd65f5604465438d9272
tree3095b6d1dc10310953ec48ffb5b964bf01319993
parent19358cc31317dca4642417066c1445ce00438e18
ash: parser: Fix parsing of ${}

Upstream commit:

    Date: Tue, 3 Apr 2018 00:40:25 +0800
    parser: Fix parsing of ${}

    dash -c 'echo ${}' should print "Bad subtitution" but instead
    fails with "Syntax error: Missing '}'".  This is caused by us
    reading an extra character beyond the right brace.  This patch
    fixes it so that this construct only fails during expansion rather
    than during parsing.

    Fixes: 3df3edd13389 ("[PARSER] Report substition errors at...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
function                                             old     new   delta
readtoken1                                          2907    2916      +9

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c