hush/shell/ash_test
Ron Yorston 549deab5ab ash: move parse-time quote flag detection to run-time
Because the parser does not recursively parse parameter expansion
with respect to quotes, we can't accurately determine quote status at
parse time.  This patch works around this by moving the quote detection
to run-time where we do interpret it recursively.

Test case:
   foo=\\ echo "<${foo#[\\]}>"
Old result:
   <\>
New result:
   <>

Do not quote back slashes in parameter expansions outside quotes.

Test case:
   a=/b/c/*
   b=\\
   echo ${a%$b*}
Old result:
   /b/c/*
New result:
   /b/c/

Based on commits 880d952, 7cfd8be, 0d7d660 and a7c21a6 from
git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu

function                                             old     new   delta
argstr                                              1164    1193     +29
memtodest                                            147     174     +27
subevalvar                                          1153    1177     +24
redirect                                            1279    1282      +3
dolatstr                                               5       7      +2
static.spclchars                                      10       9      -1
expandarg                                            962     960      -2
evalcase                                             273     271      -2
evalcommand                                         1204    1197      -7
rmescapes                                            236     227      -9
preglob                                               27       8     -19
evalvar                                              604     582     -22
cmdputs                                              389     334     -55
readtoken1                                          3163    3061    -102
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/9 up/down: 85/-219)          Total: -134 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-05-18 09:57:51 +02:00
..
ash-alias small ash testsuite, adapted from bash 2007-03-05 00:27:50 +00:00
ash-arith shell/math: deconvolute and explain ?: handling. Give better error message 2010-09-16 11:50:46 +02:00
ash-heredoc ash: fix handling of duplicate "local" 2015-04-18 19:36:38 +02:00
ash-invert add ash testcases 2007-03-05 20:46:46 +00:00
ash-misc ash: make "locak VAR" unset VAR (bash does that) 2014-03-16 18:41:11 +01:00
ash-quoting ash: fix obscure case of replacing + globbing + backslashes 2010-06-26 22:55:44 +02:00
ash-read shell: split read builtin from ash 2010-01-12 22:11:24 +01:00
ash-redir ash: fix a bug in >${varexp} handling. Closes 5282 2012-06-09 02:06:57 +02:00
ash-signals slightly better wording in comments 2011-02-21 03:47:50 +01:00
ash-standalone ash: fix unset in standalone mode 2010-06-18 14:23:47 +02:00
ash-vars ash: move parse-time quote flag detection to run-time 2015-05-18 09:57:51 +02:00
printenv.c - use EXIT_{SUCCESS,FAILURE}. No object-code changes 2008-05-19 09:29:47 +00:00
recho.c whitespace cleanup 2010-10-29 11:46:52 +02:00
run-all ash: fix . builtin 2009-06-14 19:42:12 +02:00
zecho.c whitespace cleanup 2010-10-29 11:46:52 +02:00