ash: remove parsebackquote flag
authorRon Yorston <rmy@frippery.org>
Wed, 1 Jul 2015 15:45:40 +0000 (16:45 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 13 Jul 2015 01:50:27 +0000 (03:50 +0200)
commit0e056f7e9efcebbbb85444221e141b37d3ab79e6
tree99836b8ecfbf80cea732c709eebc1304a762d185
parent97f2f7ca7fe10783a592087df989a7f394492fa1
ash: remove parsebackquote flag

Commit 503a0b8 from git://git.kernel.org/pub/scm/utils/dash/dash.git
by Herbert Xu says:

  >The parsebackquote flag is only used in a test where it always has the
  >value zero.  So we can remove it altogether.

The first statement is incorrect:  parsebackquote is non-zero when
backquotes (as opposed to $(...)) are used for command substitution.
It is possible for the test to be executed with parsebackquote != 0 in
that case.

The test is question checks whether quotes have been closed, raising
the error "unterminated quoted string" if they haven't.  There seems
to be no good reason to allow unclosed quotes within backquotes.  Bash,
hush and dash (after commit 503a0b8) all treat the following as an error:

   XX=`"pwd`

whereas BusyBox ash doesn't.  It just ignores the unclosed quote and
executes pwd.

So, parsebackquote should be removed but not for the reason stated.

function                                             old     new   delta
parsebackquote                                         1       -      -1
readtoken1                                          3222    3182     -40
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-41)             Total: -41 bytes

Signed-off-by: Ron Yorston <rmy@frippery.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c
shell/ash_test/ash-misc/tickquote1.right [new file with mode: 0644]
shell/ash_test/ash-misc/tickquote1.tests [new file with mode: 0755]