oweals/busybox.git
14 years agohush: better function and parameter names
Denys Vlasenko [Fri, 10 Sep 2010 08:44:23 +0000 (10:44 +0200)]
hush: better function and parameter names

Also, trim code which isn't needed for non-bash compat.
No logic changes.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fixes to testsuite
Denys Vlasenko [Fri, 10 Sep 2010 08:19:22 +0000 (10:19 +0200)]
hush: fixes to testsuite

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix var_bash5.tests failure
Denys Vlasenko [Fri, 10 Sep 2010 08:17:53 +0000 (10:17 +0200)]
hush: fix var_bash5.tests failure

function                                             old     new   delta
expand_one_var                                      1513    1552     +39
expand_pseudo_dquoted                                118     135     +17
expand_string_to_string                              110     126     +16
setup_heredoc                                        298     308     +10
expand_and_evaluate_arith                             69      79     +10
parse_stream_dquoted                                 233     241      +8
setup_redirects                                      220     225      +5
run_list                                             956     961      +5
expand_assignments                                    76      81      +5
run_pipe                                            1587    1590      +3
parse_stream                                        2371    2374      +3
builtin_umask                                        132     133      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 12/0 up/down: 122/0)            Total: 122 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix var_bash3.tests failure
Denys Vlasenko [Fri, 10 Sep 2010 08:15:18 +0000 (10:15 +0200)]
hush: fix var_bash3.tests failure

function                                             old     new   delta
expand_one_var                                      1513    1538     +25
parse_stream_dquoted                                 233     241      +8
expand_pseudo_dquoted                                118     126      +8
setup_heredoc                                        298     303      +5
expand_and_evaluate_arith                             69      74      +5
parse_stream                                        2371    2374      +3
builtin_umask                                        132     133      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 7/0 up/down: 55/0)               Total: 55 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: remove useless ESC_GLOB_CHARS clears/resotres
Denys Vlasenko [Fri, 10 Sep 2010 08:12:34 +0000 (10:12 +0200)]
hush: remove useless ESC_GLOB_CHARS clears/resotres

function                                             old     new   delta
o_addQstr                                             43     165    +122
expand_on_ifs                                        210     189     -21
expand_vars_to_list                                 1122    1094     -28
o_addqblock                                          139       -    -139
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/2 up/down: 122/-188)          Total: -66 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix a bug where expand_one_var wasn't restoring 1st char of the encoded $var
Denys Vlasenko [Thu, 9 Sep 2010 12:38:46 +0000 (14:38 +0200)]
hush: fix a bug where expand_one_var wasn't restoring 1st char of the encoded $var

function                                             old     new   delta
expand_one_var                                      1515    1513      -2
expand_vars_to_list                                 1133    1122     -11

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: make parse_dollar flag quited status regardless of glob escaping status
Denys Vlasenko [Thu, 9 Sep 2010 12:04:57 +0000 (14:04 +0200)]
hush: make parse_dollar flag quited status regardless of glob escaping status

function                                             old     new   delta
parse_stream_dquoted                                 228     233      +5
parse_stream                                        2369    2371      +2
parse_dollar                                         730     717     -13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 7/-13)              Total: -6 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: simplification in parse_stream, parse_stream_dquoted
Denys Vlasenko [Thu, 9 Sep 2010 11:32:21 +0000 (13:32 +0200)]
hush: simplification in parse_stream, parse_stream_dquoted

function                                             old     new   delta
parse_stream                                        2354    2369     +15
parse_stream_dquoted                                 250     228     -22

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: simplify parse_stream_dquoted
Denys Vlasenko [Thu, 9 Sep 2010 10:58:19 +0000 (12:58 +0200)]
hush: simplify parse_stream_dquoted

function                                             old     new   delta
parse_stream_dquoted                                 303     250     -53

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: straighten out the logic in parse_stream
Denys Vlasenko [Thu, 9 Sep 2010 10:40:03 +0000 (12:40 +0200)]
hush: straighten out the logic in parse_stream

function                                             old     new   delta
parse_stream                                        2399    2354     -45

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoAvoid side effects in putc(), which may be implemented as a macro
Dan Fandrich [Wed, 8 Sep 2010 06:38:28 +0000 (23:38 -0700)]
Avoid side effects in putc(), which may be implemented as a macro

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: eliminate redundant parameter of expand_vars_to_list()
Denys Vlasenko [Wed, 8 Sep 2010 11:58:55 +0000 (13:58 +0200)]
hush: eliminate redundant parameter of expand_vars_to_list()

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: replace flag bytes in struct o_string with bit flags
Denys Vlasenko [Wed, 8 Sep 2010 11:44:34 +0000 (13:44 +0200)]
hush: replace flag bytes in struct o_string with bit flags

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: remove unused enum typedef
Denys Vlasenko [Wed, 8 Sep 2010 11:33:26 +0000 (13:33 +0200)]
hush: remove unused enum typedef

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix set -- q w e; (IFS='' echo "$*"; IFS=''; echo "$*"); echo "$*"
Denys Vlasenko [Wed, 8 Sep 2010 11:31:53 +0000 (13:31 +0200)]
hush: fix set -- q w e; (IFS='' echo "$*"; IFS=''; echo "$*"); echo "$*"

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agonc: show help text on bad parameters
Denys Vlasenko [Tue, 7 Sep 2010 16:41:56 +0000 (18:41 +0200)]
nc: show help text on bad parameters

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: do not hang on error, but return error indicator.
Denys Vlasenko [Tue, 7 Sep 2010 16:40:53 +0000 (18:40 +0200)]
lineedit: do not hang on error, but return error indicator.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoshell: unify endofname() in hush and ash
Denys Vlasenko [Tue, 7 Sep 2010 10:19:33 +0000 (12:19 +0200)]
shell: unify endofname() in hush and ash

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>
14 years agohush: a few relatively trivial simplifications
Denys Vlasenko [Tue, 7 Sep 2010 07:56:34 +0000 (09:56 +0200)]
hush: a few relatively trivial simplifications

function                                             old     new   delta
helper_export_local                                  130     135      +5
set_vars_and_save_old                                 89      85      -4
expand_variables                                     147     141      -6
get_ptr_to_local_var                                  77      70      -7
get_local_var_value                                  171     164      -7
delete_finished_bg_job                                31      16     -15
hush_exit                                            101      84     -17
free_pipe_list                                        31      12     -19
check_and_run_traps                                  232     205     -27
free_pipe                                            205     130     -75
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/9 up/down: 5/-177)           Total: -172 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: style cleanups. no code changes
Denys Vlasenko [Tue, 7 Sep 2010 07:53:50 +0000 (09:53 +0200)]
hush: style cleanups. no code changes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoAgain fix license line format
Denys Vlasenko [Mon, 6 Sep 2010 15:41:46 +0000 (17:41 +0200)]
Again fix license line format

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoblockdev: code shrink
Denys Vlasenko [Mon, 6 Sep 2010 15:37:52 +0000 (17:37 +0200)]
blockdev: code shrink

function                                             old     new   delta
blockdev_main                                        292     255     -37

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoblockdev: make "blockdev --rereadpt /dev/sda EXTRA_ARG" complain. +6 bytes.
Denys Vlasenko [Mon, 6 Sep 2010 14:31:18 +0000 (16:31 +0200)]
blockdev: make "blockdev --rereadpt /dev/sda EXTRA_ARG" complain. +6 bytes.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agomade 3 license strings to follow the usual form ("or later" bit is not changed!)
Denys Vlasenko [Mon, 6 Sep 2010 14:22:25 +0000 (16:22 +0200)]
made 3 license strings to follow the usual form ("or later" bit is not changed!)

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoblockdev: -2 bytes
Denys Vlasenko [Mon, 6 Sep 2010 13:34:15 +0000 (15:34 +0200)]
blockdev: -2 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agotweak blockdev's help text
Denys Vlasenko [Mon, 6 Sep 2010 12:15:46 +0000 (14:15 +0200)]
tweak blockdev's help text

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agotweak udhcpd help text
Denys Vlasenko [Mon, 6 Sep 2010 11:39:59 +0000 (13:39 +0200)]
tweak udhcpd help text

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoblockdev: new applet
Sergey Naumov [Mon, 6 Sep 2010 11:35:58 +0000 (13:35 +0200)]
blockdev: new applet

function                                             old     new   delta
blockdev_main                                          -     287    +287
bdcommands                                             -     160    +160
packed_usage                                       27203   27298     +95
applet_names                                        2297    2306      +9
applet_main                                         1352    1356      +4
applet_nameofs                                       676     678      +2
applet_install_loc                                   169     170      +1
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 5/0 up/down: 558/0)             Total: 558 bytes

Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: revert a recent buggy change which resulted in two HUSH_VERSIONs
Denys Vlasenko [Mon, 6 Sep 2010 10:10:51 +0000 (12:10 +0200)]
hush: revert a recent buggy change which resulted in two HUSH_VERSIONs

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agofix typo in comment
Denys Vlasenko [Mon, 6 Sep 2010 09:47:55 +0000 (11:47 +0200)]
fix typo in comment

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix another corner case with backslashes in heredocs
Denys Vlasenko [Mon, 6 Sep 2010 09:46:03 +0000 (11:46 +0200)]
hush: fix another corner case with backslashes in heredocs

function                                             old     new   delta
parse_stream                                        2395    2432     +37

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix backslash and terminator handling in <<[-]["]heredoc["]
Denys Vlasenko [Mon, 6 Sep 2010 09:27:32 +0000 (11:27 +0200)]
hush: fix backslash and terminator handling in <<[-]["]heredoc["]

function                                             old     new   delta
parse_stream                                        2339    2395     +56
expand_pseudo_dquoted                                104     118     +14
parse_stream_dquoted                                 296     300      +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 74/0)               Total: 74 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix globbing+backslashes in unquoted $var expansion
Denys Vlasenko [Mon, 6 Sep 2010 08:26:37 +0000 (10:26 +0200)]
hush: fix globbing+backslashes in unquoted $var expansion

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: remove disabled CMD_SINGLEWORD_NOGLOB_COND, rename o_glob->perform_glob
Denys Vlasenko [Mon, 6 Sep 2010 08:22:13 +0000 (10:22 +0200)]
hush: remove disabled CMD_SINGLEWORD_NOGLOB_COND, rename o_glob->perform_glob

+ other small tweaks to comments and such

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoshell: remove lash and bbsh
Denys Vlasenko [Mon, 6 Sep 2010 08:18:21 +0000 (10:18 +0200)]
shell: remove lash and bbsh

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agorunit_lib: remove/inline a few more things
Denys Vlasenko [Sun, 5 Sep 2010 17:28:29 +0000 (19:28 +0200)]
runit_lib: remove/inline a few more things

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agotar: add a test for extraction of read-only directory
Dan Fandrich [Sun, 5 Sep 2010 14:16:46 +0000 (16:16 +0200)]
tar: add a test for extraction of read-only directory

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoremove redundant ENABLE_DESKTOP in procps/ps.c
Cristian Ionescu-Idbohrn [Sun, 5 Sep 2010 12:34:42 +0000 (14:34 +0200)]
remove redundant ENABLE_DESKTOP in procps/ps.c

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: big reordering: move parser functions to the beginning. no code changes
Denys Vlasenko [Sun, 5 Sep 2010 12:50:59 +0000 (14:50 +0200)]
hush: big reordering: move parser functions to the beginning. no code changes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: rename o_quoted to has_quoted_part; small code shrink
Denys Vlasenko [Sun, 5 Sep 2010 12:49:40 +0000 (14:49 +0200)]
hush: rename o_quoted to has_quoted_part; small code shrink

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: move variable expansion into a separate function. No logic changes
Denys Vlasenko [Sun, 5 Sep 2010 12:48:11 +0000 (14:48 +0200)]
hush: move variable expansion into a separate function. No logic changes

function                                             old     new   delta
expand_one_var                                         -    1551   +1551
expand_vars_to_list                                 2833    1175   -1658
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 1551/-1658)       Total: -107 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: add support for ${var/pattern/repl}, conditional on bash compat
Denys Vlasenko [Sun, 5 Sep 2010 12:45:38 +0000 (14:45 +0200)]
hush: add support for ${var/pattern/repl}, conditional on bash compat

function                                             old     new   delta
expand_vars_to_list                                 2386    2833    +447
expand_string_to_string                               69     110     +41
parse_dollar                                         681     721     +40
hush_main                                            963     945     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 528/-18)           Total: 510 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: optimize #[#] and %[%] for speed. size -2 bytes.
Denys Vlasenko [Sat, 4 Sep 2010 19:21:07 +0000 (21:21 +0200)]
hush: optimize #[#] and %[%] for speed. size -2 bytes.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agohush: fix handling of backslashes in variable assignment
Denys Vlasenko [Sat, 4 Sep 2010 17:52:44 +0000 (19:52 +0200)]
hush: fix handling of backslashes in variable assignment

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolzop: fix misordered "v=NULL; free(v)", small code shrink
Denys Vlasenko [Sat, 4 Sep 2010 17:46:52 +0000 (19:46 +0200)]
lzop: fix misordered "v=NULL; free(v)", small code shrink

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agofix false positive in testsuite/tar.tests
Denys Vlasenko [Fri, 3 Sep 2010 15:22:56 +0000 (17:22 +0200)]
fix false positive in testsuite/tar.tests

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoFix some test cases
Dan Fandrich [Fri, 3 Sep 2010 01:38:00 +0000 (18:38 -0700)]
Fix some test cases

The tar tests still don't pass, but at least now it's because of
a problem with Busybox and not the tests themselves.

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoifupdown: %client%, not %clientid%
Denys Vlasenko [Fri, 3 Sep 2010 14:58:37 +0000 (16:58 +0200)]
ifupdown: %client%, not %clientid%

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: on tab completion, show filenames obly in all cases (bash compat)
Denys Vlasenko [Fri, 3 Sep 2010 12:11:08 +0000 (14:11 +0200)]
lineedit: on tab completion, show filenames obly in all cases (bash compat)

function                                             old     new   delta
complete_cmd_dir_file                                731     730      -1

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: allocate matchBuf only temporarily: saves MAX_LINELEN bytes
Denys Vlasenko [Fri, 3 Sep 2010 12:09:24 +0000 (14:09 +0200)]
lineedit: allocate matchBuf only temporarily: saves MAX_LINELEN bytes

function                                             old     new   delta
input_tab                                           1027    1041     +14
build_match_prefix                                   590     562     -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-28)            Total: -14 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: de-indent large block in input_tab. No logic changes.
Denys Vlasenko [Fri, 3 Sep 2010 12:08:24 +0000 (14:08 +0200)]
lineedit: de-indent large block in input_tab. No logic changes.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: rename tmp -> chosen_match; small code shrink
Denys Vlasenko [Fri, 3 Sep 2010 11:05:51 +0000 (13:05 +0200)]
lineedit: rename tmp -> chosen_match; small code shrink

function                                             old     new   delta
input_tab                                           1016    1012      -4

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: stop using permanent int_buf[] (16k!): allocate it
Denys Vlasenko [Fri, 3 Sep 2010 11:02:47 +0000 (13:02 +0200)]
lineedit: stop using permanent int_buf[] (16k!): allocate it

Now it is allocated temporarily only for the duretion of prefix generation,
and also we only allocate the needed size, not maximally possible.

function                                             old     new   delta
build_match_prefix                                   579     590     +11
remove_chunk                                          43      28     -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 11/-15)             Total: -4 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: remove pos_buf[] array (up to 16k!); fix compat bugs
Denys Vlasenko [Fri, 3 Sep 2010 10:59:15 +0000 (12:59 +0200)]
lineedit: remove pos_buf[] array (up to 16k!); fix compat bugs

pos_buf is a strange hack, easy to do without it.
This also allows lines >32k long to be handled.
Also simplified match prefix generations and made behavior more like bash.

function                                             old     new   delta
remove_chunk                                           -      43     +43
collapse_pos                                          79       -     -79
build_match_prefix                                   804     579    -225
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 43/-304)          Total: -261 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: return prefix len from tab completion helpers
Denys Vlasenko [Fri, 3 Sep 2010 10:56:36 +0000 (12:56 +0200)]
lineedit: return prefix len from tab completion helpers

This kills horrific logic which deletes and re-adds prefix (!)

function                                             old     new   delta
complete_cmd_dir_file                                705     731     +26
complete_username                                    121     124      +3
input_tab                                           1041    1016     -25
build_match_prefix                                   838     804     -34
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 29/-59)            Total: -30 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: clean up tab completion code (variable reuse, comments)
Denys Vlasenko [Fri, 3 Sep 2010 10:53:15 +0000 (12:53 +0200)]
lineedit: clean up tab completion code (variable reuse, comments)

Noted bugs in behavior.
Added debugging machinery.
Decoupled variables reused for unrelated purposes: apparently,
when not forced to use liveness analysis, gcc fares better.

function                                             old     new   delta
complete_cmd_dir_file                                699     705      +6
collapse_pos                                          75      79      +4
build_match_prefix                                   892     838     -54
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 10/-54)            Total: -44 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agopreparatory cleanup patch for tab completion fixes
Denys Vlasenko [Fri, 3 Sep 2010 10:51:36 +0000 (12:51 +0200)]
preparatory cleanup patch for tab completion fixes

renames and deinlines a few functions

function                                             old     new   delta
input_tab                                              -    1041   +1041
complete_cmd_dir_file                                  -     699    +699
complete_username                                      -     121    +121
username_completion                                  121       -    -121
read_line_input                                     5002    3313   -1689
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 0/1 up/down: 1861/-1810)         Total: 51 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: small readability improvement (same code)
Denys Vlasenko [Thu, 2 Sep 2010 10:44:39 +0000 (12:44 +0200)]
lineedit: small readability improvement (same code)

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: fix completion with Unicode chars
Denys Vlasenko [Thu, 2 Sep 2010 10:03:11 +0000 (12:03 +0200)]
lineedit: fix completion with Unicode chars

function                                             old     new   delta
read_line_input                                     4966    5002     +36
bb_wcstombs                                          170     159     -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 36/-11)             Total: 25 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolineedit: preparatory cleanup patch for Unicode completion fix
Denys Vlasenko [Thu, 2 Sep 2010 10:01:11 +0000 (12:01 +0200)]
lineedit: preparatory cleanup patch for Unicode completion fix

Some logic changes and function renames. The fix will follow this patch,
to mkae it distinct from cleanup.

function                                             old     new   delta
build_match_prefix                                     -     892    +892
username_completion                                    -     121    +121
read_line_input                                     4902    4966     +64
username_tab_completion                              235       -    -235
find_match                                           892       -    -892
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 1/0 up/down: 1077/-1127)        Total: -50 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolibbb: xfunc_error_retval can be a byte
Denys Vlasenko [Wed, 1 Sep 2010 14:04:24 +0000 (16:04 +0200)]
libbb: xfunc_error_retval can be a byte

function                                             old     new   delta
xfunc_die                                             55      60      +5
log_and_exit                                          43      45      +2
hush_main                                            961     963      +2
xfunc_error_retval                                     4       1      -3
tty_main                                              87      84      -3
sv_main                                             1183    1180      -3
sort_main                                            804     801      -3
run_applet_no_and_exit                               440     437      -3
puts_maybe_newline                                   198     195      -3
nohup_main                                           228     225      -3
httpd_main                                           753     750      -3
get_header_tar                                      1496    1493      -3
fsck_minix_main                                     2972    2969      -3
expr_main                                            110     107      -3
cmp_main                                             641     638      -3
chat_main                                           1359    1356      -3
builtin_exit                                          48      45      -3
arping_main                                         1587    1584      -3
BB_EXECVP_or_die                                      47      44      -3
send_cgi_and_exit                                    901     895      -6
diff_main                                           1197    1191      -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/18 up/down: 9/-60)            Total: -51 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agouudecode,base64: code shrink
Denys Vlasenko [Wed, 1 Sep 2010 11:24:05 +0000 (13:24 +0200)]
uudecode,base64: code shrink

function                                             old     new   delta
read_base64                                          373     358     -15

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agobetter shared strings trick
Denys Vlasenko [Wed, 1 Sep 2010 10:01:17 +0000 (12:01 +0200)]
better shared strings trick

   text    data     bss     dec     hex filename
 861980     441    7540  869961   d4649 busybox_old
 861914     441    7540  869895   d4607 busybox_unstripped

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agogetty: small code shrink
Denys Vlasenko [Wed, 1 Sep 2010 09:31:43 +0000 (11:31 +0200)]
getty: small code shrink

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agofind: add rudimentary support for -exec {} +
Denys Vlasenko [Tue, 31 Aug 2010 17:17:42 +0000 (19:17 +0200)]
find: add rudimentary support for -exec {} +

function                                             old     new   delta
parse_params                                        1421    1414      -7

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agobase64: new applet
Denys Vlasenko [Tue, 31 Aug 2010 12:09:22 +0000 (14:09 +0200)]
base64: new applet

function                                             old     new   delta
base64_main                                            -     217    +217
packed_usage                                       27181   27229     +48
read_base64                                          348     373     +25
applet_names                                        2299    2306      +7
bbconfig_config_bz2                                 4942    4948      +6
applet_main                                         1352    1356      +4
applet_nameofs                                       676     678      +2
applet_install_loc                                   169     170      +1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 7/0 up/down: 310/0)             Total: 310 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agolibbb: add xfstat function
Denys Vlasenko [Tue, 31 Aug 2010 10:42:06 +0000 (12:42 +0200)]
libbb: add xfstat function

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>
14 years agomkswap: clear 1st kilobyte. Closes bug 1831
Denys Vlasenko [Mon, 30 Aug 2010 23:50:03 +0000 (01:50 +0200)]
mkswap: clear 1st kilobyte. Closes bug 1831

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoiplink: another compat #ifndef/#define tweak
Denys Vlasenko [Mon, 30 Aug 2010 17:20:09 +0000 (19:20 +0200)]
iplink: another compat #ifndef/#define tweak

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoash: small code shrink (-21 bytes)
Denys Vlasenko [Mon, 30 Aug 2010 13:20:07 +0000 (15:20 +0200)]
ash: small code shrink (-21 bytes)

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoash: add another ${v/a/b} test we currently fail
Denys Vlasenko [Mon, 30 Aug 2010 11:54:12 +0000 (13:54 +0200)]
ash: add another ${v/a/b} test we currently fail

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agotypo fix in comment
Denys Vlasenko [Sun, 29 Aug 2010 23:19:47 +0000 (01:19 +0200)]
typo fix in comment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoremove stray debugging stuff
Denys Vlasenko [Sun, 29 Aug 2010 12:39:45 +0000 (14:39 +0200)]
remove stray debugging stuff

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agobbconfig: add COMPRESS_BBCONFIG option
Denys Vlasenko [Sun, 29 Aug 2010 12:36:11 +0000 (14:36 +0200)]
bbconfig: add COMPRESS_BBCONFIG option

function                                             old     new   delta
bbconfig_config_bz2                                    -    4905   +4905
bbconfig_main                                         13      70     +57
bbconfig_config                                    21811       -  -21811
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/0 up/down: 4962/-21811)    Total: -16849 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agonandwrite: always check the first erase block
Baruch Siach [Sun, 29 Aug 2010 07:36:50 +0000 (10:36 +0300)]
nandwrite: always check the first erase block

Current code does not check the first erase block when mtdoffset is not erase
block aligned. Fix this.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agonandwrite: complain on malformed -s NUM
Denys Vlasenko [Sun, 29 Aug 2010 11:29:02 +0000 (13:29 +0200)]
nandwrite: complain on malformed -s NUM

Elsewhere: use common error message. -30 bytes net size change

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agonandwrite: allow hex values in the -s parameter
Baruch Siach [Sun, 29 Aug 2010 07:36:49 +0000 (10:36 +0300)]
nandwrite: allow hex values in the -s parameter

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoshowkey: code shrink
Denys Vlasenko [Sun, 29 Aug 2010 03:00:40 +0000 (05:00 +0200)]
showkey: code shrink

function                                             old     new   delta
signal_handler                                        52      45      -7
showkey_main                                         461     454      -7
xset1                                                 40      29     -11

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotestsuite: show the number of failures after a test run
Dan Fandrich [Sun, 29 Aug 2010 02:47:03 +0000 (04:47 +0200)]
testsuite: show the number of failures after a test run

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotypo fixes in config help text
Denys Vlasenko [Sun, 29 Aug 2010 00:06:50 +0000 (02:06 +0200)]
typo fixes in config help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agopmap: new applet. +1k.
Alexander Shishkin [Sat, 28 Aug 2010 21:20:34 +0000 (23:20 +0200)]
pmap: new applet. +1k.

pmap is a tool used to look at processes' memory maps, normally found
in procps package. It provides more readable and easily sortable output
(one line per mapping) from  maps/smaps files in /proc/PID/.  This would
help in debugging memory usage issues, especially on devices where lots
of typing is not a viable option.

This patch does'n implement -d and -A command line options of GNU pmap,
since those are not that must have features and I was afraid of going
blind from looking at its code.

The implementation takes smaps scanning part out of procps_scan() function
and moves it into procps_read_smaps(), which does more detailed processing
of a single PID's smaps data.

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agontpd: with -q, exit after 60 seconds even if time is not synced.
Denys Vlasenko [Fri, 27 Aug 2010 00:15:01 +0000 (02:15 +0200)]
ntpd: with -q, exit after 60 seconds even if time is not synced.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agomodutils: explain why we no longer quote params
Denys Vlasenko [Wed, 25 Aug 2010 16:26:46 +0000 (18:26 +0200)]
modutils: explain why we no longer quote params

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoinsmod: Do not add a pair of "" around the arguments of the module.
Carmelo AMOROSO [Tue, 24 Aug 2010 04:01:13 +0000 (06:01 +0200)]
insmod: Do not add a pair of "" around the arguments of the module.

If there are some spaces in the insmod command line, then
this will be splitted in single words as separate elements of
argv. It just needs to chain them together in the options string
passed to the sys_init_module syscall.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agonandwrite: new applet
Baruch Siach [Wed, 25 Aug 2010 14:36:17 +0000 (16:36 +0200)]
nandwrite: new applet

function                                             old     new   delta
nandwrite_main                                         -     382    +382
packed_usage                                       27119   27135     +16
applet_names                                        2275    2285     +10
applet_main                                         1340    1344      +4
applet_nameofs                                       670     672      +2
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 4/0 up/down: 414/0)             Total: 414 bytes

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
14 years agoRename a struct member from "interrupt"
Dan Fandrich [Tue, 24 Aug 2010 05:23:04 +0000 (22:23 -0700)]
Rename a struct member from "interrupt"

This is nonstandard, but common, keyword in embedded compilers.

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agosplit: use xopen_stdin()
Denys Vlasenko [Mon, 23 Aug 2010 01:06:46 +0000 (03:06 +0200)]
split: use xopen_stdin()

function                                             old     new   delta
split_main                                           558     543     -15

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agogrep: fix -o match with empty string (suggested by Colin Watson <cjwatson@ubuntu...
Denys Vlasenko [Mon, 23 Aug 2010 00:39:47 +0000 (02:39 +0200)]
grep: fix -o match with empty string (suggested by Colin Watson <cjwatson@ubuntu.com>)

function                                             old     new   delta
grep_file                                           1216    1251     +35

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoip: add a #define for older kernels
Denys Vlasenko [Sun, 22 Aug 2010 08:02:55 +0000 (10:02 +0200)]
ip: add a #define for older kernels

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agobuild system: make 3.82 fix. Closes bug 2323
Denys Vlasenko [Sun, 22 Aug 2010 07:28:46 +0000 (09:28 +0200)]
build system: make 3.82 fix. Closes bug 2323

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agopatch: support "patch [FILE [PATCH]]" format
Denys Vlasenko [Sun, 22 Aug 2010 03:39:15 +0000 (05:39 +0200)]
patch: support "patch [FILE [PATCH]]" format

function                                             old     new   delta
xopen_stdin                                            -      15     +15
patch_main                                          2075    2041     -34

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb: fix fallout from last patch to obscure() (my mistake). +143 bytes
Denys Vlasenko [Tue, 17 Aug 2010 15:21:36 +0000 (17:21 +0200)]
libbb: fix fallout from last patch to obscure() (my mistake). +143 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibbb: shrink obscure()
Bob Dunlop [Tue, 17 Aug 2010 14:01:16 +0000 (16:01 +0200)]
libbb: shrink obscure()

function                                             old     new   delta
string_checker_helper                                 59      45     -14
string_checker                                       116      98     -18
obscure                                              367     204    -163
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-195)           Total: -195 bytes

Signed-off-by: Bob Dunlop <bob.dunlop@xyzzy.org.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agopatch: fix -N regression
Denys Vlasenko [Mon, 16 Aug 2010 23:31:40 +0000 (01:31 +0200)]
patch: fix -N regression

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agonmeter: fix misplaced closing comment
Denys Vlasenko [Mon, 16 Aug 2010 18:42:14 +0000 (20:42 +0200)]
nmeter: fix misplaced closing comment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years ago*: make GNU licensing statement forms more regular
Denys Vlasenko [Mon, 16 Aug 2010 18:14:46 +0000 (20:14 +0200)]
*: make GNU licensing statement forms more regular

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>
14 years agosed: make N command behave as in GNU sed
Denys Vlasenko [Mon, 16 Aug 2010 14:26:33 +0000 (16:26 +0200)]
sed: make N command behave as in GNU sed

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agomdev: fix non-working device deletion, add a test for that
Denys Vlasenko [Mon, 16 Aug 2010 12:26:15 +0000 (14:26 +0200)]
mdev: fix non-working device deletion, add a test for that

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoplatform.h: regularize endian detection
Denys Vlasenko [Mon, 16 Aug 2010 01:24:40 +0000 (03:24 +0200)]
platform.h: regularize endian detection

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years ago*: fix "see file License ..." - the file is named LICENSE (in uppercase)
Denys Vlasenko [Mon, 16 Aug 2010 01:04:14 +0000 (03:04 +0200)]
*: fix "see file License ..." - the file is named LICENSE (in uppercase)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>