aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
AgeCommit message (Collapse)Author
2010-09-25ash: fix signal and "set -e" interactionDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-09-16shell/math: deconvolute and explain ?: handling. Give better error messageDenys Vlasenko
function old new delta arith_apply 1271 1283 +12 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-15shell/math: return string error indicator, not integerDenys Vlasenko
function old new delta expand_and_evaluate_arith 87 106 +19 expand_one_var 1563 1570 +7 arith 12 18 +6 evaluate_string 678 680 +2 arith_apply 1269 1271 +2 builtin_umask 133 132 -1 ash_arith 118 75 -43 expand_vars_to_list 1094 1038 -56 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/3 up/down: 36/-100) Total: -64 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-13shell/math.c: rename arith_eval_hooks to arith_state, put error code into itDenys Vlasenko
function old new delta expand_and_evaluate_arith 79 89 +10 arith 675 674 -1 arith_lookup_val 151 142 -9 ash_arith 135 122 -13 arith_apply 1304 1269 -35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 10/-58) Total: -48 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-12ash: shrink by folding an if check into setprompt; unindent big blockDenys Vlasenko
function old new delta setprompt_if - 66 +66 parseheredoc 126 124 -2 parsecmd 68 66 -2 redirect 1254 1249 -5 xxreadtoken 351 343 -8 readtoken1 3219 3204 -15 setprompt 62 - -62 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/5 up/down: 66/-94) Total: -28 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-12ash: add missing casts to match CTLfoo; add TODO commentsDenys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-09Avoid side effects in putc(), which may be implemented as a macroDan Fandrich
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-07shell: unify endofname() in hush and ashDenys Vlasenko
function old new delta builtin_umask 132 133 +1 changepath 195 194 -1 expand_and_evaluate_arith 77 69 -8 ash_arith 143 135 -8 expand_one_var 1551 1515 -36 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 1/-53) Total: -52 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-06hush: remove disabled CMD_SINGLEWORD_NOGLOB_COND, rename o_glob->perform_globDenys Vlasenko
+ other small tweaks to comments and such Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-08-31libbb: add xfstat functionDenys Vlasenko
function old new delta xfstat - 25 +25 mkfs_ext2_main 2421 2423 +2 mkfs_reiser_main 1197 1194 -3 next 312 307 -5 ar_main 533 522 -11 mkfs_minix_main 2938 2924 -14 mkfs_vfat_main 1511 1495 -16 writeTarFile 272 255 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 27/-66) Total: -39 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-08-30ash: small code shrink (-21 bytes)Denys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-08-16*: make GNU licensing statement forms more regularDenys Vlasenko
This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-07ash: fix another bit of var_bash4 bugDenys Vlasenko
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-07ash: cosmetic fixes, no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-06ash: fix another bug detected by var_bash4.testsDenys Vlasenko
... but var_bash4.tests still does not pass! function old new delta expandarg 959 962 +3 localcmd 259 257 -2 readtoken1 3275 3260 -15 subevalvar 1178 1141 -37 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 3/-54) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-06ash: fix dequoting error detected by var_bash4 testDenys Vlasenko
But the test still fails (one more bug to fix) function old new delta changepath 195 192 -3 readtoken1 3247 3240 -7 subevalvar 1204 1184 -20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-30) Total: -30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-05ash: add a testcase for bug 2281 (currently fails). Small code cleanups.Denys Vlasenko
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-07-26*: mass cosmetic removal of extra empty lines. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-25ash: fix $! value when traps are setAlexander Shishkin
Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-16cttyhack: move build system bits into cttyhack.c, no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-16ash: move config stuff into ash.c, no code chagesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-26ash: fix obscure case of replacing + globbing + backslashesDenys Vlasenko
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-26build system: do not rebuild ash and hush on any change to any .c fileDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-24ash: <> redir should not truncateAndreas Bühmann
Signed-off-by: Andreas Bühmann <buehmann@users.berlios.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18ash: times builtin: use unsigned type; take free-of-charge moduloDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18*: stop defining _GNU_SOURCE in source files, it's in CFLAGS anywayDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18ash: fix unset in standalone modeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18ash: cosmetics, no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06fix a few goofs uncovered by "make allnoconfig" testingDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-03ash: rename parsefile->fd to ->pf_fdDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-03ash: fix redirection of fd 0 in scripts are sourced from interactive ashDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-02*: better string sharingDenys Vlasenko
text data bss dec hex filename 849427 441 7556 857424 d1550 busybox_old 849355 441 7556 857352 d1508 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-02ash: remove one redundant function, improve string sharing, better field namesDenys Vlasenko
function old new delta var_end - 15 +15 changepath 194 192 -2 setvareq 222 218 -4 lookupvar 57 51 -6 bltinlookup 57 51 -6 evalfun 452 443 -9 varequal 14 - -14 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/5 up/down: 15/-41) Total: -26 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-23shell: consolidate builtin_foo.? into shell_common.?; delete obsolete shellsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-20ash: eliminate 16 bytes in bssDenys Vlasenko
text data bss dec hexfilename 841423 441 7572 849436 cf61cbusybox_old 841430 441 7556 849427 cf613busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18ash: fix var_leak.tests so that it actually catches the NOFORK bugDenys Vlasenko
+ document the bug better Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18typo fixDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18ash: fix bug which causes signal6.tests to failDenys Vlasenko
function old new delta trapcmd 271 277 +6 localcmd 277 275 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-18ash,hush: make bare "." set exitcode to 2Denys Vlasenko
function old new delta dotcmd 300 305 +5 builtin_source 176 171 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17ash,hush: make "source" a synonym for . if bash compat is onDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17ash: fix ". empty_file" exitcode. +5 bytesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17ash: use CONFIG_FEATURE_EDITING_MAX_LENDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-17ash: fix signal5.testsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-26ash: refresh stack pointers after makestrspace in rmescapesColin Watson
Without this, rmescapes sometimes returns random garbage while performing parameter expansions such as ${foo#bar}, in the event that the allocation of r happens to need to reallocate the stack and hence invalidate str and p. I'd love to provide a test case but unfortunately it's dependent on exact stack layout, so I don't have anything simpler than the situation described in https://bugs.launchpad.net/ubuntu/+source/partman-base/+bug/527401/comments/23 which involved a sequence of foo="${foo#*, }" expansions on a long string inside our RAID configuration tool. The same fix has been in dash since 2007-09-26, contributed by Roy Marples <uberlord@gentoo.org>. I actually came up with it independently almost to the character, but then synced it up with the variable naming used in dash when I noticed that change afterwards. Signed-off-by: Colin Watson <cjwatson@ubuntu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26ash: line up builtin table. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26ash: trap with bad signal name should not abortDenys Vlasenko
function old new delta trapcmd 236 271 +35 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-23ash,hush: make it possible to build them individuallyDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-13ash: fix quadratic matching slowdown is ${v/*foo*/repl} (really bad one)Denys Vlasenko
It is especially bad with patterns starting with "*". With ASH_OPTIMIZE_FOR_SIZE=y, only those are optimized, +few bytes: text data bss dec hex filename 836337 441 7564 844342 ce236 busybox_old 836341 441 7564 844346 ce23a busybox_unstripped With ASH_OPTIMIZE_FOR_SIZE off, we also optimize patterns _ending_ with "*", which costs about 80 bytes: text data bss dec hex filename 836656 441 7564 844661 ce375 busybox_old 836732 441 7564 844737 ce3c1 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-06hush: use ash's ulimit builtin; make it more more bash0like while at itDenys Vlasenko
Based on a patch by Tobias Klauser <tklauser@distanz.ch> function old new delta shell_builtin_ulimit - 498 +498 limits_tbl 33 88 +55 ulimit_opt_string - 38 +38 bltins1 288 300 +12 limits_name 127 - -127 ulimitcmd 415 7 -408 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 2/1 up/down: 603/-535) Total: 68 bytes text data bss dec hex filename 839229 453 6828 846510 ceaae busybox_old 839423 453 6828 846704 ceb70 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-05*: use NULL for null pointersDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>