aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* hush: specially handle [[ - suppress globbing & multiword expansionDenys Vlasenko2009-06-091-20/+112
| | | | | | It's a bashism, but is surprisingly easy to do and costs very little code. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: drop REDIRECT_INVALID; other minor tweaksDenys Vlasenko2009-06-071-42/+38
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a segfault in export builtinDenys Vlasenko2009-06-071-13/+12
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: make builtins work in pipes (eval ... | ...) on NOMMUDenys Vlasenko2009-06-061-91/+183
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: add FAST_FUNC to function ptrs where it makes senseDenys Vlasenko2009-06-051-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta evalcommand 1195 1209 +14 testcmd - 10 +10 printfcmd - 10 +10 echocmd - 10 +10 func_exec 270 276 +6 echo_dg 104 109 +5 store_nlmsg 85 89 +4 pseudo_exec_argv 195 198 +3 dotcmd 287 290 +3 machtime_stream 29 31 +2 discard_stream 24 26 +2 argstr 1299 1301 +2 killcmd 108 109 +1 evalfor 226 227 +1 daytime_stream 43 44 +1 run_list 2544 2543 -1 lookupvar 62 61 -1 ipaddr_modify 1310 1309 -1 ... parse_stream 2254 2245 -9 evalpipe 356 347 -9 collect_if 210 197 -13 read_opt 869 851 -18 handle_dollar 681 658 -23 print_addrinfo 1342 1303 -39 iterate_on_dir 156 59 -97 print_route 1709 1609 -100 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 12/130 up/down: 74/-767) Total: -693 bytes text data bss dec hex filename 841748 467 7872 850087 cf8a7 busybox_old 841061 467 7872 849400 cf5f8 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: document a TODO in export builtinDenys Vlasenko2009-06-031-2/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix a case when backgrounded cmd makes shell hangDenys Vlasenko2009-06-031-0/+2
| | | | | Signed-off-by: Bayram Kurumahmut <kbayram@ubicom.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: add support for local builtinDenys Vlasenko2009-06-031-70/+174
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: unify syntax_error_unterm_{ch,str} a bitMike Frysinger2009-06-011-9/+7
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: push down expansion var in handle_dollar()Mike Frysinger2009-06-011-2/+3
| | | | | | | Declare the variable in the scope it is used rather than the entire function scope so it's obvious it is only used there. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: add support for special vars in bracesMike Frysinger2009-06-011-0/+3
| | | | | | | Some people like to use ${?} rather than $?, so make sure we support all the special single char vars that use this form. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* nc, hush: cosmetic cleanups, no code changesDenys Vlasenko2009-06-011-13/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key: drop optimization where we read 3 bytes at onceDenys Vlasenko2009-05-291-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hust: trivial simplification in builtin_typeDenys Vlasenko2009-05-281-3/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix bug 353 (wrong handling of \x in assignments)Denys Vlasenko2009-05-281-22/+15
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: optimize type builtin a bit moreDenys Vlasenko2009-05-281-6/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: optimize type builtin a bitDenys Vlasenko2009-05-281-11/+10
| | | | | | | function old new delta builtin_type 130 125 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: implement `type`Mike Frysinger2009-05-271-27/+78
| | | | | | | | | | Implement support for the POSIX `type` command. Only POSIX stuff is supported here, no bash extensions like -p or -P. In the process, split the $PATH searching code out of builtin_source() and into its own find_in_path() function so we don't duplicate it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hush: remove outdated TODO and superfluous macro; fix compile breakageDenys Vlasenko2009-05-271-5/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: tweak commentDenys Vlasenko2009-05-261-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>