aboutsummaryrefslogtreecommitdiff
path: root/shell/msh.c
AgeCommit message (Collapse)Author
2009-08-21msh: aliased to hushDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-06hush: make builtins work in pipes (eval ... | ...) on NOMMUDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-04-09hush: plug the leak of expanded heredocDenis Vlasenko
2009-04-04hush: fix NOMMU hangs in pseudo_exec_argv. Add forgotted settingDenis Vlasenko
of signal mask. Reuse same help string in all shells. function old new delta builtin_exit 49 47 -2 pseudo_exec_argv 149 145 -4 builtin_help 74 63 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-17) Total: -17 bytes text data bss dec hex filename 825379 476 7616 833471 cb7bf busybox_old 825341 476 7616 833433 cb799 busybox_unstripped
2009-03-09*: move get_sock_lsa and xwrite_str to libbb, use where appropriateDenis Vlasenko
function old new delta get_sock_lsa - 72 +72 buffer_fill_and_print 179 196 +17 parse_expr 824 832 +8 read_base64 343 348 +5 nameval 202 206 +4 fbset_main 1694 1698 +4 expand 1849 1853 +4 udhcp_send_kernel_packet 249 252 +3 udhcp_get_option 223 222 -1 chat_main 1246 1245 -1 pack_gzip 1661 1659 -2 doset 299 297 -2 bb__parsespent 119 117 -2 test_main 260 257 -3 qgravechar 109 106 -3 tcpudpsvd_main 1834 1830 -4 sysctl_display_all 589 580 -9 xopen_xwrite_close 44 33 -11 prs 30 18 -12 find_main 418 406 -12 full_write2_str 25 12 -13 adduser_main 667 654 -13 evaltreenr 817 802 -15 evaltree 817 802 -15 tftpd_main 526 493 -33 ftpd_main 2050 1990 -60 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 7/18 up/down: 117/-211) Total: -94 bytes
2008-07-21- fix spellingBernhard Reutner-Fischer
2008-07-20msh: fix "while...continue" bug 3884.Denis Vlasenko
2008-07-05*: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko
2008-06-09msh: style cleanups. No code changes.Denis Vlasenko
2008-05-30msh: fix the case where the file has exec bit but can't be run directlyDenis Vlasenko
(run "$SHELL $file" instead) msh: fix exit codes when command is not found or can't be execed (with testcases)
2008-05-19- use STD*_FILENO some more. No object-code changesBernhard Reutner-Fischer
2008-05-19- use EXIT_{SUCCESS,FAILURE}. No object-code changesBernhard Reutner-Fischer
2008-05-14fix by Jie Zhang for exit status and POSIX compliance:Mike Frysinger
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html The exit status of a command that terminated because it received a signal shall be reported as greater than 128.
2008-04-15trivial fixes to make bbox compile with gcc 4.3.0Denis Vlasenko
2008-03-24*: whitespace fixes, no code changesDenis Vlasenko
2008-03-24lpr: add more accurate commentsDenis Vlasenko
*: trailing whitespace removal
2008-03-17*: add -Wunused-parameter; fix resulting breakageDenis Vlasenko
function old new delta procps_scan 1265 1298 +33 aliascmd 278 283 +5 parse_file_cmd 116 120 +4 dname_enc 373 377 +4 setcmd 90 93 +3 execcmd 57 60 +3 count_lines 72 74 +2 process_command_subs 340 339 -1 test_main 409 407 -2 mknod_main 179 177 -2 handle_incoming_and_exit 2653 2651 -2 argstr 1312 1310 -2 shiftcmd 131 128 -3 exitcmd 46 43 -3 dotcmd 297 294 -3 breakcmd 86 83 -3 evalpipe 353 349 -4 evalcommand 1180 1176 -4 evalcmd 109 105 -4 send_tree 374 369 -5 mkfifo_main 82 77 -5 evalsubshell 152 147 -5 typecmd 75 69 -6 letcmd 61 55 -6 add_cmd 1190 1183 -7 main 891 883 -8 ash_main 1415 1407 -8 parse_stream 1377 1367 -10 alloc_procps_scan 55 - -55 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148) Total: -94 bytes text data bss dec hex filename 797195 658 7428 805281 c49a1 busybox_old 797101 658 7428 805187 c4943 busybox_unstripped
2008-03-02msh: a few fields renamed; short->int conversion for a fieldDenis Vlasenko
holding file descriptors; short->smalling for flag field synio 263 264 +1 readc 247 242 -5 forkexec 1339 1307 -32 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 1/-37) Total: -36 bytes
2008-03-02libbb: inntroduce and use bb_pstrcmp() and qsort_string_vector()Denis Vlasenko
msh: glob0/glob1/glob2/glob3 are just a sorting routine! remove them. bb_pstrcmp - 25 +25 qsort_string_vector - 24 +24 expand 2209 2227 +18 getopt32 1359 1370 +11 passwd_main 1072 1074 +2 handle_incoming_and_exit 2737 2735 -2 UNSPEC_print 66 64 -2 forkexec 1343 1339 -4 input_tab 3338 3330 -8 get_dir 185 177 -8 expmeta 481 473 -8 cmdputs 405 397 -8 xstrcmp 12 - -12 find_pair 187 167 -20 match_compare 25 - -25 dir_strcmp 25 - -25 glob2 27 - -27 glob3 34 - -34 glob1 256 - -256 ------------------------------------------------------------------------------ (add/remove: 2/6 grow/shrink: 3/8 up/down: 80/-439) Total: -359 bytes
2008-03-02msh: renames: ->words => ->op_words, space() => get_space()Denis Vlasenko
msh: simplify glob0/glob1/glob2/glob3 get_space - 26 +26 glob3 35 34 -1 glob2 28 27 -1 strsave 55 53 -2 globv 4 - -4 func 4 - -4 xstrcmp 25 12 -13 dodot 178 164 -14 rexecve 272 257 -15 space 26 - -26 glob1 292 256 -36 expand 2246 2209 -37 ------------------------------------------------------------------------------ (add/remove: 1/3 grow/shrink: 0/8 up/down: 26/-153) Total: -127 bytes
2008-03-01msh: fix for bug 846 ("break" didn't work second time)Denis Vlasenko
msh: don't use floating point in "times" builtin +4 bytes difference
2008-02-27*: add optimization barrier to all "G trick" locationsDenis Vlasenko
2008-02-20libbb: introduce and use nonblock_safe_read(). Yay!Denis Vlasenko
Our shells are immune from this nasty O_NONBLOCK now! function old new delta nonblock_safe_read - 78 +78 file_get 276 295 +19 generateMTFValues 428 435 +7 read_line_input 1776 1772 -4 preadbuffer 543 450 -93 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/2 up/down: 104/-97) Total: 7 bytes text data bss dec hex filename 615190 715 23924 639829 9c355 busybox_old 615168 715 23924 639807 9c33f busybox_unstripped
2008-02-16random s/short/int/Denis Vlasenko
add_cmd 1189 1190 +1 xconnect_ftpdata 118 117 -1 data_align 86 84 -2 process_files 2101 2096 -5 forkexec 1345 1334 -11
2008-02-12msh: stop trying to parse variables in "msh SCRIPT VAR=val param".Denis Vlasenko
They should be passed as ordinary parameters.
2008-02-12msh: instead of fixing "ls | cd", "cd | ls" etc just disallowDenis Vlasenko
builtins in pipes. They make no sense there anyway. msh: shrink umask builtin. function old new delta execute 2508 2509 +1 doset 326 317 -9 forkexec 1370 1345 -25 doumask 165 101 -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 1/-98) Total: -97 bytes
2008-02-12msh: shrink, mainly by using smallintsDenis Vlasenko
function old new delta synio 251 263 +12 filechar 310 315 +5 subgetc 781 785 +4 brkcontin 106 109 +3 ... yylex 981 976 -5 execute 2513 2508 -5 waitfor 321 315 -6 onintr 103 97 -6 doset 332 326 -6 doexec 186 180 -6 yyparse 65 57 -8 thenpart 135 126 -9 forkexec 1379 1370 -9 onecommand 457 433 -24 newtp 52 28 -24 command 1086 1061 -25 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 7/23 up/down: 27/-163) Total: -136 bytes
2008-02-11msh: do not run pipes where last command is a builtinDenis Vlasenko
msh: code shrink and some renames for better readability
2008-02-02msh: also handle EOF/read errors correctlyDenis Vlasenko
2008-02-02msh: fix Ctrl-C handling with line editingDenis Vlasenko
2008-01-28*: tidy up usage of char **environDenis Vlasenko
2008-01-02libbb: introduce and use safe_waitpid (loops in EINTR)Denis Vlasenko
*: use more approproate (shorter) versions of wait() function old new delta safe_waitpid - 48 +48 wait_any_nohang - 17 +17 send_tree 365 369 +4 processorstop 432 435 +3 text_yank 110 108 -2 make_human_readable_str 202 200 -2 crond_main 1368 1366 -2 handle_sigchld 49 43 -6 reapchild 166 159 -7 custom 260 250 -10 checkscript 191 177 -14 wait_nohang 17 - -17 wait_pid 43 - -43 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 2/7 up/down: 72/-103) Total: -31 bytes
2007-12-16msh: reduce global data/bss usageDenis Vlasenko
(add/remove: 1/5 grow/shrink: 28/6 up/down: 464/-394) Total: 70 bytes text data bss dec hex filename 778077 908 7568 786553 c0079 busybox_old 778330 860 7408 786598 c00a6 busybox_unstripped
2007-12-02attack the biggest stack users:Denis Vlasenko
-mkfs_minix_main [busybox_unstripped]: 4288 -mkfs_minix_main [busybox_unstripped]: 4276 -grave [busybox_unstripped]: 4260 (bzip2 users too - not listed) price we pay in code size increase: mainSort 2458 2515 +57 grave 1005 1058 +53 sendMTFValues 2177 2195 +18 BZ2_blockSort 122 125 +3 mkfs_minix_main 3070 3022 -48 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 131/-48) Total: 83 bytes
2007-11-28reorganize applet table. Eliminates pointers to names.Denis Vlasenko
Should be a big win for libbusybox. busybox wins too: text data bss dec hex filename 776524 929 9100 786553 c0079 busybox_old 775903 929 9100 785932 bfe0c busybox_unstripped
2007-10-11add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-09-27introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).Denis Vlasenko
2007-08-12trylink: produce even more info about final link stageDenis Vlasenko
trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
2007-06-25Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms ↵Denis Vlasenko
<wharms@bfs.de>)
2007-06-13*: BB_BANNER -> bb_banner (it is not a const or #define)!Denis Vlasenko
correct_password: explain in detail why it is ok to use bb_banner fsck_minix: make it print bb version, not it's own (outdated/irrelevant) one Marginal size difference: text data bss dec hex filename 679119 2700 15632 697451 aa46b busybox_old 679091 2700 15632 697423 aa44f busybox_unstripped
2007-06-12remove nearly-duplicate PATHs in several placesDenis Vlasenko
function old new delta bb_PATH_root_path - 35 +35 varunset 60 58 -2 arith 2042 2033 -9 bb_default_root_login_path 30 - -30 .rodata 128794 128762 -32 which_main 152 117 -35 defpathvar 40 - -40 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 0/4 up/down: 35/-148) Total: -113 bytes
2007-06-12A few more string duplicates found & eliminatedDenis Vlasenko
# size busybox_old busybox_unstripped text data bss dec hex filename 679693 2700 15632 698025 aa6a9 busybox_old 679523 2700 15632 697855 aa5ff busybox_unstripped
2007-06-08make busybox --install work even if /proc/self/exe doesn't existDenis Vlasenko
# size busybox_old busybox_unstripped text data bss dec hex filename 680095 2704 15648 698447 aa84f busybox_old 680099 2704 15648 698451 aa853 busybox_unstripped
2007-05-30whitespace fixesDenis Vlasenko
2007-05-09msh: fix obscure case with backticks and closed fd 1Denis Vlasenko
2007-04-16shells: remove few statics and duplicated codeDenis Vlasenko
(much more of the same remains, alas) function old new delta doset 330 332 +2 warn 53 51 -2 onecommand 463 461 -2 ioecho 40 38 -2 forkexec 1412 1410 -2 err 81 79 -2 setdash 59 56 -3 flag 4 - -4 msh_main 1389 1384 -5 eval 388 381 -7 subgetc 759 747 -12 static.local 14 - -14 b_adduint 70 52 -18 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 1/10 up/down: 2/-73) Total: -71 bytes
2007-04-14msh: style fixesDenis Vlasenko
shell/README - a place to record things about busybox shells
2007-04-14lineedit: nuke two unused variables and code which sets themDenis Vlasenko
applets: do not even try to read config if run by real root msh: use named constants (O_RDONLY etc) in open() instead of magic numbers, other minor code size reduction.
2007-04-12pass a copy of argv[i] to NOFORK applets (they may permute it etc).Denis Vlasenko
set/save/restore more shared global variables whan call one applet from another
2007-04-12style fixes. No code changesDenis Vlasenko