aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* hush: two NOMMU fixes for bugs 877 and 883Denys Vlasenko2010-01-121-3/+12
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: plug a memory leakDenys Vlasenko2010-01-121-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix exitcodes of killed processesDenys Vlasenko2010-01-041-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix fallout from isprint() changesDenys Vlasenko2009-11-201-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: improve HUSH_BRACE_EXP code (still disabled). ~0 bytesDenys Vlasenko2009-11-171-62/+163
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak in commentDenys Vlasenko2009-11-161-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: initial stab at brace expansion supportDenys Vlasenko2009-11-161-4/+133
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix handling of words with braces. +65 bytesDenys Vlasenko2009-11-161-8/+21
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix exit code propagation from `cmd`. +45 bytesDenys Vlasenko2009-11-161-2/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: added xfdopen_for_read/writeDenys Vlasenko2009-11-151-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta xfdopen_helper - 40 +40 logdir_open 1163 1184 +21 process_stdin 433 443 +10 xfdopen_for_write - 9 +9 doCommands 2465 2474 +9 patch_main 1214 1222 +8 bbunpack 457 465 +8 xfdopen_for_read - 7 +7 scan_tree 258 262 +4 xstrtoul_range_sfx 230 231 +1 sendmail_main 957 955 -2 passwd_main 1027 1023 -4 parse 969 964 -5 test_main 253 247 -6 sed_main 655 649 -6 dos2unix_main 437 429 -8 fbsplash_main 950 938 -12 handle_dir_common 371 354 -17 expand_vars_to_list 2197 2169 -28 update_passwd 1275 1246 -29 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 7/10 up/down: 117/-117) Total: 0 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: wait for `cmd` to complete, and immediately store its exitcode in $?Denys Vlasenko2009-11-151-18/+18
| | | | | | | function old new delta expand_vars_to_list 2129 2197 +68 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use ffulsh_all()Denys Vlasenko2009-11-021-7/+7
| | | | | | | | | | | | | | | | | | | | 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>
* build failure fix and some cosmeticsDenys Vlasenko2009-10-231-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix exec builtin in a better way (+ "glob in exec" bug fixed)Denys Vlasenko2009-10-191-24/+17
| | | | | | | | | | | | function old new delta execvp_or_die - 50 +50 static.pseudo_null_str 3 - -3 builtin_exec 83 57 -26 pseudo_exec_argv 200 163 -37 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/2 up/down: 50/-66) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: use configured max line length, not BUFSIZE from libcDenys Vlasenko2009-10-191-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: remove superfluous assignmentDenys Vlasenko2009-10-191-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: make it compile again :/Denys Vlasenko2009-10-191-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: cosmetics. no code changesDenys Vlasenko2009-10-191-65/+66
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix handling of empty argumentsDenys Vlasenko2009-10-181-11/+32
| | | | | | | | | | | | function old new delta builtin_exec 25 83 +58 parse_stream 2242 2261 +19 run_pipe 1782 1787 +5 static.pseudo_null_str - 3 +3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 85/0) Total: 85 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: handle empty execsMike Frysinger2009-10-181-0/+6
| | | | | | | | Sometimes variable expansions yield empty strings, and if they happen to be a command someone wants to run like `$foo`, then hush currently segfaults. So handle `` and $(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: add a printf builtinMike Frysinger2009-10-151-0/+13
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: unify handling of builtin appletsMike Frysinger2009-10-151-8/+8
| | | | | | Saves about 10 bytes for each additional builtin applet. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ash,hush: fix $RANDOM in children being repeatedDenys Vlasenko2009-10-121-2/+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>
* hush: shrink $RANDOM supportDenys Vlasenko2009-10-111-7/+4
| | | | | | | | function old new delta get_local_var_value 104 125 +21 hush_main 1024 983 -41 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix cut-n-paste error in last commitDenys Vlasenko2009-10-091-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add support for $RANDOM. If on:Denys Vlasenko2009-10-091-0/+16
| | | | | | | | | | | | | | function old new delta hush_main 983 1024 +41 get_local_var_value 72 104 +32 block_signals 155 161 +6 reset_traps_to_defaults 211 214 +3 builtin_wait 268 271 +3 pseudo_exec_argv 198 200 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/0 up/down: 87/0) Total: 87 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: support $PPIDDenys Vlasenko2009-10-091-4/+15
| | | | | | | | | | | function old new delta get_local_var_value 33 72 +39 hush_main 951 983 +32 block_signals 152 155 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 74/0) Total: 74 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: code shrink via NOINLINEDenys Vlasenko2009-10-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta expand_vars_to_list - 2118 +2118 lzo1x_optimize - 1429 +1429 run_pipe 358 1775 +1417 arith_apply - 1335 +1335 mainQSort3 - 1198 +1198 logdir_open - 1163 +1163 rewrite - 1039 +1039 dump_identity - 987 +987 do_shm - 884 +884 cpio_o - 863 +863 cpio_main 1450 560 -890 ipcs_main 3442 2523 -919 bb_dump_dump 2611 1488 -1123 process_dev 4572 3405 -1167 logdirs_reopen 1308 86 -1222 arith 2084 707 -1377 mainSort 2622 1202 -1420 do_lzo_compress 2276 799 -1477 run_list 2491 943 -1548 expand_variables 2280 135 -2145 ------------------------------------------------------------------------------ (add/remove: 9/0 grow/shrink: 1/10 up/down: 12433/-13288) Total: -855 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: share stringDenys Vlasenko2009-09-291-4/+7
| | | | | | | | | | | | | function old new delta optschanged 133 139 +6 hush_main 997 982 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 6/-15) Total: -9 bytes text data bss dec hexfilename 823160 445 7668 831273 caf29busybox_old 823102 445 7668 831215 caeefbusybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: make trap output short signal names, without SIG prefixDenys Vlasenko2009-09-271-2/+5
| | | | | | | | | 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>
* hush: do not reset to default "" traps in subshellDenys Vlasenko2009-09-251-18/+23
| | | | | | | | function old new delta reset_traps_to_defaults 164 211 +47 builtin_umask 123 121 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: document a TODO. no code changesDenys Vlasenko2009-09-251-2/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: small speed optimization. +10 bytes.Denys Vlasenko2009-09-241-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: fix trap reporting: s/SIGEXIT/EXIT/Denys Vlasenko2009-09-241-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more portability fixes by Dan FandrichDenys Vlasenko2009-09-231-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix `trap`Denys Vlasenko2009-09-231-1/+43
| | | | | | | | function old new delta expand_variables 2217 2280 +63 static.argv - 8 +8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: better wording in comments. no code changesDenys Vlasenko2009-09-211-4/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: make memleak debugging more robustDenys Vlasenko2009-09-121-0/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: code shrink by Dan Fandrich (dan AT coneharvesters.com)Denys Vlasenko2009-09-121-39/+35
| | | | | | | | | | function old new delta find_function_slot - 47 +47 run_list 2508 2491 -17 find_function 40 8 -32 builtin_unset 227 165 -62 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove some GNUisms. by Dan Fandrich (dan AT coneharvesters.com)Denys Vlasenko2009-09-061-2/+3
| | | | | | | | | | function old new delta logdirs_reopen 1310 1308 -2 read_line_input 4757 4753 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-6) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: export PWDDenys Vlasenko2009-09-051-3/+58
| | | | | | | | | | | | | function old new delta set_pwd_var - 36 +36 hush_main 941 951 +10 evalvar 1365 1363 -2 ash_main 1364 1362 -2 builtin_cd 75 72 -3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/3 up/down: 46/-7) Total: 39 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* msh: aliased to hushDenys Vlasenko2009-08-211-0/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: enable "lash is deprecated, please use hush instead" messageDenys Vlasenko2009-08-201-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: do not process options after non-option argsDenys Vlasenko2009-08-201-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix \<newline> handling on NOMMUDenys Vlasenko2009-08-121-1/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush tests: remove the requirement that .config is in ../..Denys Vlasenko2009-08-121-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove trailing whitespaceDenys Vlasenko2009-07-151-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix . builtinDenys Vlasenko2009-06-141-14/+1
| | | | | | Also, move [[ ]] comment to test.c and expand it Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* added comments about [[ ]] to ash and hush. no code changesDenys Vlasenko2009-06-101-0/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add HUSH_BASH_COMPAT, make [[ special handling depend on itDenys Vlasenko2009-06-101-24/+34
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>