Commit Graph

66 Commits

Author SHA1 Message Date
Denys Vlasenko
36f774a0cd hush: add support for ${var/pattern/repl}, conditional on bash compat
function                                             old     new   delta
expand_vars_to_list                                 2386    2833    +447
expand_string_to_string                               69     110     +41
parse_dollar                                         681     721     +40
hush_main                                            963     945     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 528/-18)           Total: 510 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-05 14:47:58 +02:00
Denys Vlasenko
e298ce69ba hush: fix handling of backslashes in variable assignment
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-04 19:52:44 +02:00
Denys Vlasenko
f7a8433535 ash: add another ${v/a/b} test we currently fail
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-08-30 13:54:12 +02:00
Denys Vlasenko
33bbb27e45 ash: fix another bit of var_bash4 bug
But it _still_ doesn't pass! quoted case is a tough nut to crack

function                                             old     new   delta
redirect                                            1281    1286      +5
subevalvar                                          1141    1142      +1

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-07 22:24:36 +02:00
Denys Vlasenko
c8d305d89f var_bash4.tests: better wording in comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-06 19:28:04 +02:00
Denys Vlasenko
f56fe82542 update var_bash4 test. one more bug revealed by it now...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-06 17:21:52 +02:00
Denys Vlasenko
6814cbc928 ash: extend var_bash4.tests; nocode changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-05 18:29:13 +02:00
Denys Vlasenko
b0fbe4b540 ash: add a testcase for bug 2281 (currently fails). Small code cleanups.
function                                             old     new   delta
changepath                                           195     192      -3
subevalvar                                          1204    1200      -4
readtoken1                                          3247    3240      -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-14)             Total: -14 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-05 17:19:27 +02:00
Alexander Shishkin
ccb9771861 ash: fix $! value when traps are set
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-25 13:07:39 +02:00
Denys Vlasenko
fd33e17a2b ash: fix obscure case of replacing + globbing + backslashes
function                                             old     new   delta
subevalvar                                          1152    1178     +26
readtoken1                                          3267    3275      +8
redirect                                            1284    1286      +2
expandarg                                            957     958      +1
expdir                                                 4       -      -4
evalcommand                                         1219    1209     -10
expmeta                                              481     469     -12
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 4/2 up/down: 37/-26)             Total: 11 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-26 22:55:44 +02:00
Andreas Bühmann
da75f44844 ash: <> redir should not truncate
Signed-off-by: Andreas Bühmann <buehmann@users.berlios.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-24 04:32:37 +02:00
Denys Vlasenko
7df28bbb8f ash: fix unset in standalone mode
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18 14:23:47 +02:00
Denys Vlasenko
08d8b3cee1 ash: fix redirection of fd 0 in scripts are sourced from interactive ash
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-03 04:28:28 +02:00
Denys Vlasenko
42c4b2e3b5 ash: fix var_leak.tests so that it actually catches the NOFORK bug
+ document the bug better

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18 16:13:56 +02:00
Denys Vlasenko
238bf187ba ash: fix bug which causes signal6.tests to fail
function                                             old     new   delta
trapcmd                                              271     277      +6
localcmd                                             277     275      -2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18 15:49:07 +02:00
Denys Vlasenko
51b4a9e2f1 ash: fix var_leak testcase
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18 14:35:20 +02:00
Denys Vlasenko
5e2d572381 ash: fix testsuite false positives
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18 14:11:21 +02:00
Denys Vlasenko
cd10dc40e4 ash: fix ". empty_file" exitcode. +5 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17 17:10:46 +02:00
Denys Vlasenko
786cce1871 fix false positive in signal5.tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17 10:14:20 +02:00
Denys Vlasenko
0f01b00d74 add two more tests which currently fail
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17 04:57:55 +02:00
Denys Vlasenko
7c1ed9fbde ash: fix signal5.tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17 04:42:40 +02:00
Denys Vlasenko
27ff681cfa ash: add two testcases for (not yet fixed) ash bugs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17 02:56:18 +02:00
Denys Vlasenko
496d5bf4c6 ash: trap with bad signal name should not abort
function                                             old     new   delta
trapcmd                                              236     271     +35

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 15:52:24 +01:00
Denys Vlasenko
7426920461 fix bug 1087. Fix by Leonid (lly.dev AT gmail.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-21 01:26:42 +01:00
Denys Vlasenko
7306727d1b shell: split read builtin from ash
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-12 22:11:24 +01:00
Denys Vlasenko
8cd04d1cb6 ash: fix for read $IFS splitting. Closes bug 235
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-08 15:44:07 +01:00
Denys Vlasenko
e3c6e19015 laguage and copyright date corrections, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-09 23:35:30 +02:00
Denys Vlasenko
3dc4a3e4dc ash: make one testsuite entry more robust
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-09 23:08:28 +02:00
Denys Vlasenko
e74aaf9385 ash,hush: make trap output short signal names, without SIG prefix
function                                             old     new   delta
evalvar                                             1373    1371      -2
builtin_trap                                         457     441     -16
trapcmd                                              260     236     -24

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-27 02:05:45 +02:00
Denys Vlasenko
21d87d495a ash: better handling of EXIT trap in trap hack
function                                             old     new   delta
forkchild                                              -     602    +602
trapcmd                                              255     347     +92
ash_main                                            1362    1375     +13
evalvar                                             1371    1373      +2
popstring                                            140     134      -6
forkshell                                            835     248    -587
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/2 up/down: 709/-593)          Total: 116 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-25 00:06:51 +02:00
Denys Vlasenko
844f990926 ash: fix trap
function                                             old     new   delta
forkshell                                            738     810     +72
popstring                                            134     140      +6
parse_command                                       1460    1463      +3
evalvar                                             1373    1371      -2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 81/-2)              Total: 79 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-23 03:25:52 +02:00
Denys Vlasenko
795633463a add a testcase for reopened bug 585 (not fixed yet)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-16 14:04:07 +02:00
Denys Vlasenko
9f2e82ad2e ash: add testsuite for bug 585
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-29 20:37:09 +02:00
Denys Vlasenko
82a6fb3ea6 ash: fix . builtin
Also, move [[ ]] comment to test.c and expand it

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-14 19:42:12 +02:00
Denis Vlasenko
46aeab9a34 ash: fix $IFS handling in read. closes bug 235 2009-03-31 19:18:17 +00:00
Denis Vlasenko
727752d2d2 ash: better fix for ash -c 'echo 5&' and ash -c 'sleep 5&'
with testcase
2008-11-28 03:41:47 +00:00
Denis Vlasenko
6214941a3a ash: add testcase for bug 5304 2008-10-27 14:33:03 +00:00
Denis Vlasenko
078323010b dc: conditionalize parts which require libm 2008-10-20 08:43:10 +00:00
Denis Vlasenko
b730474bda ash: fix NOEXEC mode - we were forgetting to pass environment!
env: promote to NOEXEC
hd: promote to NOEXEC, as hexdump is NOEXEC already
2008-10-20 08:15:51 +00:00
Denis Vlasenko
d1660cb9ad ash: fix a bug in standalone mode (corrupted getopt() state) 2008-10-20 07:52:33 +00:00
Denis Vlasenko
34c73c499b ash: fix "(cat < file)" hang introduced by rev 22944. 2008-08-16 11:48:02 +00:00
Denis Vlasenko
c90e1be01b ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1" 2008-07-30 15:35:05 +00:00
Denis Vlasenko
8dbea7dbb1 ash: add slightly different testcase 2008-07-26 14:20:04 +00:00
Denis Vlasenko
5c13270359 ash: fix testcase to not sleep for whole 10 seconds,
gets annoying pretty fast. Also fix wrong message there.
2008-07-26 13:53:42 +00:00
Denis Vlasenko
4e19a9c81a ash: hopefully close bug 4324. With testcase.
function                                             old     new   delta
evaltree                                             621     869    +248
popstring                                            134     140      +6
2008-07-26 13:45:57 +00:00
Denis Vlasenko
2b2e267b43 ash: testsuite entries for last change 2008-07-25 13:40:06 +00:00
Denis Vlasenko
22f7414843 ash: prevent exec NN>&- from closing fd used for script reading 2008-07-24 22:34:43 +00:00
Denis Vlasenko
5a867317bb ash: fix a bug where redirection fds were not closed afterwards.
optimize close+fcntl(DUPFD) into dup2. add testsuites.

function                                             old     new   delta
copyfd                                                47      68     +21
argstr                                              1311    1298     -13
popredir                                             148     131     -17
redirect                                            1139    1107     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 21/-62)            Total: -41 bytes
2008-07-24 19:46:38 +00:00
Denis Vlasenko
ef527f50e6 ash: optional support for $'...\t...\n...' bashism
function                                             old     new   delta
readtoken1                                          2824    3172    +348
static.C_escapes                                       -      18     +18
parse_command                                       1504    1500      -4
SIT                                                   89      83      -6
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/2 up/down: 366/-10)           Total: 356 bytes
2008-06-23 01:52:30 +00:00
Denis Vlasenko
2659c63213 ash: fix ${var/s/r} handling, add testcase. 2008-06-14 06:04:59 +00:00