aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* ash: rename parsefile->fd to ->pf_fdDenys Vlasenko2010-06-031-15/+15
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix redirection of fd 0 in scripts are sourced from interactive ashDenys Vlasenko2010-06-031-10/+25
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: better string sharingDenys Vlasenko2010-06-021-8/+6
| | | | | | | | 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>
* ash: remove one redundant function, improve string sharing, better field namesDenys Vlasenko2010-06-021-55/+57
| | | | | | | | | | | | | | | 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>
* shell: consolidate builtin_foo.? into shell_common.?; delete obsolete shellsDenys Vlasenko2010-05-231-2/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: eliminate 16 bytes in bssDenys Vlasenko2010-05-201-26/+22
| | | | | | | | 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>
* ash: fix var_leak.tests so that it actually catches the NOFORK bugDenys Vlasenko2010-05-181-8/+14
| | | | | | + document the bug better Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixDenys Vlasenko2010-05-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix bug which causes signal6.tests to failDenys Vlasenko2010-05-181-7/+15
| | | | | | | | function old new delta trapcmd 271 277 +6 localcmd 277 275 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: make bare "." set exitcode to 2Denys Vlasenko2010-05-181-20/+25
| | | | | | | | function old new delta dotcmd 300 305 +5 builtin_source 176 171 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: make "source" a synonym for . if bash compat is onDenys Vlasenko2010-05-171-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix ". empty_file" exitcode. +5 bytesDenys Vlasenko2010-05-171-3/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: use CONFIG_FEATURE_EDITING_MAX_LENDenys Vlasenko2010-05-171-7/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix signal5.testsDenys Vlasenko2010-05-171-5/+12
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: refresh stack pointers after makestrspace in rmescapesColin Watson2010-04-261-0/+4
| | | | | | | | | | | | | | | | | | | | 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>
* ash: line up builtin table. no code changesDenys Vlasenko2010-03-261-45/+45
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: trap with bad signal name should not abortDenys Vlasenko2010-03-261-4/+10
| | | | | | | function old new delta trapcmd 236 271 +35 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: make it possible to build them individuallyDenys Vlasenko2010-03-231-4/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix quadratic matching slowdown is ${v/*foo*/repl} (really bad one)Denys Vlasenko2010-03-131-12/+59
| | | | | | | | | | | | | | | | | 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>
* hush: use ash's ulimit builtin; make it more more bash0like while at itDenys Vlasenko2010-03-061-211/+3
| | | | | | | | | | | | | | | | | | | 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>
* *: use NULL for null pointersDenys Vlasenko2010-03-051-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Replace __uClinux__ define with !BB_MMUDenys Vlasenko2010-02-211-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix bug 1087. Fix by Leonid (lly.dev AT gmail.com)Denys Vlasenko2010-02-211-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell/read: check that variable names are saneDenys Vlasenko2010-01-131-4/+0
| | | | | | | | | | function old new delta shell_builtin_read 1000 1055 +55 parse_command 1460 1463 +3 builtin_umask 121 123 +2 is_well_formed_var_name 73 66 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: use ash's read builtinDenys Vlasenko2010-01-121-4/+10
| | | | | | | | | | | | | | | | | function old new delta shell_builtin_read - 1000 +1000 set_local_var_from_halves - 24 +24 setvar2 - 7 +7 ... popstring 140 134 -6 ash_main 1375 1368 -7 setvar 184 174 -10 arith_set_local_var 36 - -36 builtin_read 1096 185 -911 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 5/23 up/down: 1038/-1007) Total: 31 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: split read builtin from ashDenys Vlasenko2010-01-121-199/+35
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use monotonic_msDenys Vlasenko2010-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | function old new delta monotonic_ms - 60 +60 process_stdin 433 443 +10 display_speed 85 90 +5 nmeter_main 672 674 +2 builtin_type 114 116 +2 bb__parsespent 117 119 +2 ifplugd_main 1110 1109 -1 acpid_main 441 440 -1 chat_main 1361 1359 -2 doCommands 2458 2449 -9 arpping 466 450 -16 run_command 268 234 -34 readcmd 1072 1034 -38 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/7 up/down: 81/-101) Total: -20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix for read $IFS splitting. Closes bug 235Denys Vlasenko2010-01-081-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix mishandling of bash-style redirectsChris Metcalf2010-01-081-1/+1
| | | | | Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: trivial optimization -6 bytesDenys Vlasenko2009-12-101-3/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix double comma in initializerDenys Vlasenko2009-12-051-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: implement set -o pipefail (conditional on bash compat). +39 bytesMichael Abbott2009-12-041-3/+21
| | | | | Signed-off-by: Michael Abbott <michael@araneidae.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: preparatory work for pipefail and code shrink. -44 bytesDenys Vlasenko2009-12-041-64/+65
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: re-enable SIGHUP on entry. Closes bug 771.Denys Vlasenko2009-12-041-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: straighten up a bit of code in varvalue()Denys Vlasenko2009-11-301-13/+18
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: more cosmetics and cleanupsDenys Vlasenko2009-11-291-48/+35
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: cosmetics, no code changesDenys Vlasenko2009-11-291-3/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: remove last "signed char"; make SIT() clearer. -12 bytesDenys Vlasenko2009-11-291-81/+54
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: randmconfig fixDenys Vlasenko2009-11-291-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: remake strange signed char machinery to be unsigned. -57 bytesDenys Vlasenko2009-11-281-387/+378
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use ffulsh_all()Denys Vlasenko2009-11-021-13/+4
| | | | | | | | | | | | | | | | | | | | function old new delta buffer_fill_and_print 179 196 +17 fflush_all - 9 +9 spawn 87 92 +5 rtcwake_main 455 453 -2 ... alarm_intr 93 84 -9 readcmd 1072 1062 -10 bb_ask 345 333 -12 more_main 845 832 -13 flush_stdout_stderr 42 23 -19 xfflush_stdout 27 - -27 flush_stderr 30 - -30 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397) Total: -366 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesDenys Vlasenko2009-10-191-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: fix $RANDOM in children being repeatedDenys Vlasenko2009-10-121-13/+4
| | | | | | | | | | | | | | | | function old new delta next_random 46 68 +22 forkshell 248 263 +15 expand_vars_to_list 2118 2131 +13 run_pipe 1775 1782 +7 popstring 134 140 +6 builtin_umask 123 121 -2 ash_main 1356 1336 -20 get_local_var_value 125 104 -21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/3 up/down: 63/-43) Total: 20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: use bbox wrappers for malloc etc instead of homegrown onesDenys Vlasenko2009-10-111-34/+44
| | | | | | | | | | | | | function old new delta popstring 134 140 +6 ckmalloc 9 - -9 ckstrdup 22 - -22 ckrealloc 24 - -24 ckzalloc 28 - -28 ------------------------------------------------------------------------------ (add/remove: 0/4 grow/shrink: 1/0 up/down: 6/-83) Total: -77 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: trivial shrink by using smaller intDenys Vlasenko2009-10-111-2/+2
| | | | | | | | | | | function old new delta copynode 197 196 -1 calcsize 127 126 -1 nodesize 54 27 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-29) Total: -29 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: factor out $RANDOM supportDenys Vlasenko2009-10-091-28/+18
| | | | | | | | | | | function old new delta next_random - 46 +46 ash_main 1361 1356 -5 change_random 132 97 -35 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 46/-40) Total: 6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: a few more NOINLINEsDenys Vlasenko2009-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta print_linkinfo - 815 +815 do_msg - 783 +783 INET_setroute - 757 +757 varvalue - 746 +746 do_sem - 637 +637 inflate_codes - 617 +617 INET6_setroute - 491 +491 edir - 370 +370 sync_cursor - 298 +298 update_utmp - 246 +246 searchLines - 165 +165 setup_alarm - 144 +144 may_wakeup - 101 +101 getNum 566 371 -195 refresh 1166 848 -318 rtcwake_main 809 479 -330 getty_main 2396 1921 -475 chpst_main 1373 746 -627 inflate_unzip_internal 1335 567 -768 evalvar 1384 612 -772 ipaddr_list_or_flush 2160 1246 -914 route_main 1585 245 -1340 ipcs_main 2523 1049 -1474 ------------------------------------------------------------------------------ (add/remove: 13/0 grow/shrink: 0/10 up/down: 6170/-7213) Total: -1043 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: compile breakage fixDenys Vlasenko2009-10-081-6/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: use {i,u}toa() where appropriateDenys Vlasenko2009-10-061-3/+1
| | | | | | | | | | | function old new delta startservice 377 363 -14 setari_u 54 40 -14 ash_main 1375 1361 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-42) Total: -42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: error out on ${#1#}, ${#$11}, ${#11#}Cristian Ionescu-Idbohrn2009-10-051-0/+2
| | | | | Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>