oweals/busybox.git
13 years agoawk: next_input_file can return NULL, don't SEGV in this case.
Denys Vlasenko [Wed, 7 Sep 2011 18:01:39 +0000 (20:01 +0200)]
awk: next_input_file can return NULL, don't SEGV in this case.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agonetworking: consolidate the IP checksum code. -129 bytes.
Baruch Siach [Wed, 7 Sep 2011 15:52:37 +0000 (17:52 +0200)]
networking: consolidate the IP checksum code. -129 bytes.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agocrond: fix the case when option -d is disabled
Denys Vlasenko [Wed, 7 Sep 2011 03:56:09 +0000 (05:56 +0200)]
crond: fix the case when option -d is disabled

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolineedit: remove SAVE_HISTORY bit, ->hist_file can be used as indicator
Denys Vlasenko [Sun, 4 Sep 2011 14:15:24 +0000 (16:15 +0200)]
lineedit: remove SAVE_HISTORY bit, ->hist_file can be used as indicator

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolineedit: add support for history saving on exit
Denys Vlasenko [Sun, 4 Sep 2011 14:12:33 +0000 (16:12 +0200)]
lineedit: add support for history saving on exit

Based on the patch by Dennis Groenen <tj.groenen@gmail.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolineedit: fix atomic replace of history file; hush: fix $HISTFILE handling
Denys Vlasenko [Sun, 4 Sep 2011 13:28:03 +0000 (15:28 +0200)]
lineedit: fix atomic replace of history file; hush: fix $HISTFILE handling

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agogrep: be GNU compatible with -f EMPTY_FILE
Lauri Kasanen [Sun, 28 Aug 2011 10:39:04 +0000 (12:39 +0200)]
grep: be GNU compatible with -f EMPTY_FILE

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agotop: fix CPU% for thread display. Closes 4081
Denys Vlasenko [Sun, 28 Aug 2011 09:57:36 +0000 (11:57 +0200)]
top: fix CPU% for thread display. Closes 4081

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoFix find -follow support
Ian Wienand [Sun, 28 Aug 2011 04:53:20 +0000 (06:53 +0200)]
Fix find -follow support

Signed-off-by: Ian Wienand <ianw@vmware.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoFixes for warnings in FreeBSD build
Denys Vlasenko [Sun, 28 Aug 2011 03:31:49 +0000 (05:31 +0200)]
Fixes for warnings in FreeBSD build

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoFixes for FreeBSD build
Matthias Andree [Sun, 28 Aug 2011 03:04:07 +0000 (05:04 +0200)]
Fixes for FreeBSD build

Signed-off-by: Matthias Andree <mandree@freebsd.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agouncompress: die on read errors
Denys Vlasenko [Mon, 22 Aug 2011 02:59:41 +0000 (04:59 +0200)]
uncompress: die on read errors

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agopatch: make it able to create files (again)
Rob Landley [Mon, 22 Aug 2011 02:58:32 +0000 (04:58 +0200)]
patch: make it able to create files (again)

I broke patch's ability to create files in November, and nobody noticed in
the ensuing 11 months.  Sigh.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agouncompress: fix buffer underrun by corrupted input
Denys Vlasenko [Thu, 18 Aug 2011 12:29:41 +0000 (14:29 +0200)]
uncompress: fix buffer underrun by corrupted input

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agohostid: fix behavior on identifiers starting with zeros
Pere Orga [Thu, 11 Aug 2011 11:42:00 +0000 (13:42 +0200)]
hostid: fix behavior on identifiers starting with zeros

Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agocttyhack: trivial spelling/spacing fixes
Kevin Cernekee [Sun, 14 Aug 2011 20:35:25 +0000 (13:35 -0700)]
cttyhack: trivial spelling/spacing fixes

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agocttyhack: remove the trailing newline when reading console name from sysfs
Kevin Cernekee [Wed, 13 Jul 2011 16:29:55 +0000 (09:29 -0700)]
cttyhack: remove the trailing newline when reading console name from sysfs

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agopatch: add a test we currently fail
Denys Vlasenko [Tue, 16 Aug 2011 20:57:12 +0000 (22:57 +0200)]
patch: add a test we currently fail

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agosed: fix range handling for sed -i. Closes 4069
Denys Vlasenko [Tue, 16 Aug 2011 11:29:34 +0000 (13:29 +0200)]
sed: fix range handling for sed -i. Closes 4069

function                                             old     new   delta
sed_main                                             606     618     +12
add_cmd                                             1099    1101      +2
process_files                                       2108    2099      -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 14/-9)               Total: 5 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoless: fix for screen size detection
Denys Vlasenko [Mon, 15 Aug 2011 23:53:12 +0000 (01:53 +0200)]
less: fix for screen size detection

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoswapoff: dont pass "p" in opt_complementary
Denys Vlasenko [Sat, 13 Aug 2011 21:36:36 +0000 (23:36 +0200)]
swapoff: dont pass "p" in opt_complementary

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoconspy,nandwrite,nanddump: enable in defconfig
Denys Vlasenko [Sat, 13 Aug 2011 07:00:29 +0000 (09:00 +0200)]
conspy,nandwrite,nanddump: enable in defconfig

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoStart 1.20.0 development cycle
Denys Vlasenko [Sat, 13 Aug 2011 06:56:58 +0000 (08:56 +0200)]
Start 1.20.0 development cycle

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoBump version to 1.19.0, update copyright year in help message 1_19_0
Denys Vlasenko [Sat, 13 Aug 2011 06:46:00 +0000 (08:46 +0200)]
Bump version to 1.19.0, update copyright year in help message

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agotestsuite: fixes after randomconfig run
Denys Vlasenko [Thu, 11 Aug 2011 08:40:12 +0000 (10:40 +0200)]
testsuite: fixes after randomconfig run

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agofind: fix a bug in !ENABLE_FEATURE_FIND_XDEV config
Denys Vlasenko [Thu, 11 Aug 2011 00:27:13 +0000 (02:27 +0200)]
find: fix a bug in !ENABLE_FEATURE_FIND_XDEV config

A subtle one: wrong pairing of "else"!

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agouptime: more compatible output
Denys Vlasenko [Wed, 10 Aug 2011 11:00:04 +0000 (13:00 +0200)]
uptime: more compatible output

was: 12:59:35 up  1:57, 4 users,  load average: 0.11, 0.20, 0.53
is:  12:59:37 up  1:57,  4 users,  load average: 0.11, 0.20, 0.53

While at it, switched code to unsigned division.

Based on patch by Pere Orga <gotrunks@gmail.com>.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agorandomconfig fixes
Denys Vlasenko [Wed, 10 Aug 2011 08:45:48 +0000 (10:45 +0200)]
randomconfig fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agorandomconfig fixes
Denys Vlasenko [Tue, 9 Aug 2011 22:51:29 +0000 (00:51 +0200)]
randomconfig fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agorandomconfig fixes
Denys Vlasenko [Tue, 9 Aug 2011 20:49:15 +0000 (22:49 +0200)]
randomconfig fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoremove extra IF_WHO()
Denys Vlasenko [Tue, 9 Aug 2011 08:28:28 +0000 (10:28 +0200)]
remove extra IF_WHO()

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoremove extra += who.o
Denys Vlasenko [Tue, 9 Aug 2011 07:36:25 +0000 (09:36 +0200)]
remove extra += who.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agodf: more compatible -P behavior
Ralf Friedl [Tue, 9 Aug 2011 02:49:27 +0000 (04:49 +0200)]
df: more compatible -P behavior

In coreutils df, one of the effects of the option -P is to output
everything in one line. This makes it much easier for a script to parse
the output of df.
This patch adds the same behavior to busybox df.

function                                             old     new   delta
df_main                                              853     863     +10

Signed-off-by: Ralf Friedl <Ralf.Friedl@online.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agozcip.script: fix $ip environment variable
Thomas Petazzoni [Tue, 9 Aug 2011 02:41:00 +0000 (04:41 +0200)]
zcip.script: fix $ip environment variable

The environment variable containing the IP address allocated by zcip
is "ip" and not "IP".

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agousers: new applet.
Tito Ragusa [Tue, 9 Aug 2011 02:37:50 +0000 (04:37 +0200)]
users: new applet.

Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agouptime: add config flag to allow displaying the number of users currently logged on
Pere Orga [Tue, 9 Aug 2011 02:09:17 +0000 (04:09 +0200)]
uptime: add config flag to allow displaying the number of users currently logged on

Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agodie_if_bad_username: tighten up a bit
Denys Vlasenko [Tue, 9 Aug 2011 02:05:13 +0000 (04:05 +0200)]
die_if_bad_username: tighten up a bit

function                                             old     new   delta
die_if_bad_username                                   77      97     +20

Based on patches from Tito.
The changes are:
better comments
we disallow '@' now - in practice such usernames will be unusable
use of the portable filename character set plus '$'
don't use isalnum as it allows non-ASCII letters in legacy 8-bit locales (pointed out by Rich Felker)
enforce maximum length of LOGIN_NAME_MAX (including NUL)
don't allow '$', '.', and '-' as first char
don't print the illegal char in error message as if it is a wide char it will be unreadable
print the position of the illegal character

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agohush: fix remaining known two bugs with IFS expansion. Closes 4027.
Denys Vlasenko [Mon, 1 Aug 2011 16:16:43 +0000 (18:16 +0200)]
hush: fix remaining known two bugs with IFS expansion. Closes 4027.

function                                             old     new   delta
expand_vars_to_list                                 1054    1140     +86
parse_stream                                        2425    2479     +54
expand_on_ifs                                        258     310     +52
builtin_umask                                        133     132      -1
done_word                                            820     779     -41
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/2 up/down: 192/-42)           Total: 150 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agohush: partially fix wrong expansion on $IFS (bug 4027).
Denys Vlasenko [Mon, 1 Aug 2011 12:06:20 +0000 (14:06 +0200)]
hush: partially fix wrong expansion on $IFS (bug 4027).

In the added testcase, before patch we failed 8 out of 9 tests,
now we fail only 2 (4th and 5th).

function                                             old     new   delta
expand_on_ifs                                        225     258     +33
expand_vars_to_list                                 1038    1054     +16
o_save_ptr_helper                                    115     119      +4
builtin_umask                                        132     133      +1
o_addQstr                                            165     161      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 54/-4)              Total: 50 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agotar: ignore file size (assume 0) for hardlinks
Ian Wienand [Fri, 29 Jul 2011 06:33:47 +0000 (08:33 +0200)]
tar: ignore file size (assume 0) for hardlinks

Signed-off-by: Ian Wienand <ianw@vmware.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years ago*: work around sysinfo.h versus linux/*.h problems
Denys Vlasenko [Tue, 26 Jul 2011 11:42:12 +0000 (13:42 +0200)]
*: work around sysinfo.h versus linux/*.h problems

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agotcpudp: simplify help text
Denys Vlasenko [Mon, 25 Jul 2011 14:35:44 +0000 (16:35 +0200)]
tcpudp: simplify help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoless: add a TODO comment
Denys Vlasenko [Mon, 25 Jul 2011 13:23:52 +0000 (15:23 +0200)]
less: add a TODO comment

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoless: optionally query terminal size via "ESC [ 6 n". Closes bug 2659.
Denys Vlasenko [Mon, 25 Jul 2011 13:18:20 +0000 (15:18 +0200)]
less: optionally query terminal size via "ESC [ 6 n". Closes bug 2659.

+7 bytes is not selected, +100 if selected.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolibbb.h: do not use homegrown struct sysinfo.
Denys Vlasenko [Mon, 25 Jul 2011 09:05:43 +0000 (11:05 +0200)]
libbb.h: do not use homegrown struct sysinfo.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoandroid_defconfig: remove some extra cflags. untested
Denys Vlasenko [Sat, 23 Jul 2011 15:41:00 +0000 (17:41 +0200)]
android_defconfig: remove some extra cflags. untested

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoadd defconfig files for Android, Cygwin and FreeBSD
Daniel Fandrich [Tue, 19 Jul 2011 06:10:05 +0000 (08:10 +0200)]
add defconfig files for Android, Cygwin and FreeBSD

Also added an example script to show how to compile BusyBox against
Android's bionic.

Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agodc: fix a case where we can run off malloced space
Denys Vlasenko [Fri, 15 Jul 2011 06:37:36 +0000 (08:37 +0200)]
dc: fix a case where we can run off malloced space

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agocttyhack: fail gracefully if the device node is missing
Kevin Cernekee [Wed, 13 Jul 2011 07:30:36 +0000 (09:30 +0200)]
cttyhack: fail gracefully if the device node is missing

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agocttyhack: check sysfs for the name of the active console
Kevin Cernekee [Wed, 13 Jul 2011 07:26:58 +0000 (09:26 +0200)]
cttyhack: check sysfs for the name of the active console

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agofdisk: reinstate a short sleep between sync() and ioctl(BLKRRPART)
Denys Vlasenko [Wed, 13 Jul 2011 07:06:32 +0000 (09:06 +0200)]
fdisk: reinstate a short sleep between sync() and ioctl(BLKRRPART)

While at it, simplify code a bit.

function                                             old     new   delta
write_table                                          201     198      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolibbb/lineedit: implement optional Ctrl-R history search
Denys Vlasenko [Mon, 11 Jul 2011 05:36:59 +0000 (07:36 +0200)]
libbb/lineedit: implement optional Ctrl-R history search

function                                             old     new   delta
read_line_input                                     3433    3957    +524
load_string                                           77      90     +13
input_tab                                           1086    1069     -17
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 537/-17)           Total: 520 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agobloat-o-meter: don't require that pythin is in /usr/bin.
Lauri Kasanen [Fri, 8 Jul 2011 08:56:58 +0000 (10:56 +0200)]
bloat-o-meter: don't require that pythin is in /usr/bin.

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agomake configs/* files have _defconfig suffix
Denys Vlasenko [Fri, 8 Jul 2011 06:53:16 +0000 (08:53 +0200)]
make configs/* files have _defconfig suffix

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agomore tweak for bionic
Denys Vlasenko [Fri, 8 Jul 2011 06:49:40 +0000 (08:49 +0200)]
more tweak for bionic

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agousleep: do not check for usleep error, it should never fail
Denys Vlasenko [Fri, 8 Jul 2011 06:37:57 +0000 (08:37 +0200)]
usleep: do not check for usleep error, it should never fail

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoa few tweaks for bionic
Denys Vlasenko [Fri, 8 Jul 2011 06:34:28 +0000 (08:34 +0200)]
a few tweaks for bionic

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoSupport configuring Busybox from _defconfig files
Daniel Fandrich [Fri, 8 Jul 2011 05:59:16 +0000 (07:59 +0200)]
Support configuring Busybox from _defconfig files

The existing test .config files are moved to configs/ and renamed
to *_defconfig. 'make xyz_defconfig' will enable the
configuration in that specific file.

Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agohwclock: use locale-specific date output format
Denys Vlasenko [Fri, 8 Jul 2011 04:40:25 +0000 (06:40 +0200)]
hwclock: use locale-specific date output format

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agohalt: perror_msg_and_die needs bb_ prefix
Denys Vlasenko [Fri, 8 Jul 2011 04:23:08 +0000 (06:23 +0200)]
halt: perror_msg_and_die needs bb_ prefix

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agotypo fixes
Dan Fandrich [Fri, 8 Jul 2011 03:47:49 +0000 (05:47 +0200)]
typo fixes

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoplatform.h: tweaks for cygwin
Denys Vlasenko [Fri, 8 Jul 2011 02:41:38 +0000 (04:41 +0200)]
platform.h: tweaks for cygwin

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agohwclock: better help text
Denys Vlasenko [Mon, 4 Jul 2011 02:34:57 +0000 (04:34 +0200)]
hwclock: better help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agomd5/shaNsum: make -c support a list of files
Lauri Kasanen [Sun, 3 Jul 2011 23:49:59 +0000 (01:49 +0200)]
md5/shaNsum: make -c support a list of files

function                                             old     new   delta
md5_sha1_sum_main                                    455     473     +18

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agovi: tweak regex.h include
Denys Vlasenko [Sun, 3 Jul 2011 01:19:43 +0000 (03:19 +0200)]
vi: tweak regex.h include

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agohalt/reboot: better message if /sbin/telinit is not found
Denys Vlasenko [Sat, 2 Jul 2011 23:46:02 +0000 (01:46 +0200)]
halt/reboot: better message if /sbin/telinit is not found

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoUse the _unlocked stdio macros only when they're all available
Dan Fandrich [Thu, 30 Jun 2011 00:59:17 +0000 (02:59 +0200)]
Use the _unlocked stdio macros only when they're all available

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolibbb.h: tweak _unlocked hack
Denys Vlasenko [Thu, 30 Jun 2011 00:44:27 +0000 (02:44 +0200)]
libbb.h: tweak _unlocked hack

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoUse the built-in getline on more systems that don't have it
Dan Fandrich [Wed, 29 Jun 2011 06:03:27 +0000 (23:03 -0700)]
Use the built-in getline on more systems that don't have it

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoplatform.c: provide getline implementation
Timo Teras [Wed, 29 Jun 2011 00:19:58 +0000 (02:19 +0200)]
platform.c: provide getline implementation

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agovi: fix regex search, make it selectable in config
Walter Harms [Mon, 27 Jun 2011 00:59:37 +0000 (02:59 +0200)]
vi: fix regex search, make it selectable in config

function                                             old     new   delta
char_search                                          134     214     +80
find_pair                                            187     169     -18
mycmp                                                 37       -     -37

Signed-off-by: Walter Harms <wharms@bfs.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoid: correct getgroups usage
Denys Vlasenko [Wed, 22 Jun 2011 14:42:36 +0000 (16:42 +0200)]
id: correct getgroups usage

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agogroups: make it NOEXEC
Denys Vlasenko [Wed, 22 Jun 2011 02:17:49 +0000 (04:17 +0200)]
groups: make it NOEXEC

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agols: fix HAVE_STRVERSCMP check; add check for older uclibc versions
Denys Vlasenko [Tue, 21 Jun 2011 15:12:52 +0000 (17:12 +0200)]
ls: fix HAVE_STRVERSCMP check; add check for older uclibc versions

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agogroups: new applet
Tito Ragusa [Tue, 21 Jun 2011 15:11:40 +0000 (17:11 +0200)]
groups: new applet

Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoAdd HAVE_STRVERSCMP, guard the only usage of strverscmp with #ifdef
Denys Vlasenko [Tue, 21 Jun 2011 14:38:29 +0000 (16:38 +0200)]
Add HAVE_STRVERSCMP, guard the only usage of strverscmp with #ifdef

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agosetserial: added missing \n in help text
Dan Fandrich [Mon, 20 Jun 2011 08:22:18 +0000 (10:22 +0200)]
setserial: added missing \n in help text

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolibbb: use _unlocked variants of stdio I/O.
Denys Vlasenko [Mon, 20 Jun 2011 08:06:28 +0000 (10:06 +0200)]
libbb: use _unlocked variants of stdio I/O.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoparse_config: use getline. BIG speedup with glibc (~40%).
Timo Teras [Mon, 20 Jun 2011 07:49:56 +0000 (09:49 +0200)]
parse_config: use getline. BIG speedup with glibc (~40%).

function                                             old     new   delta
config_read                                          559     604     +45
getline                                                -      23     +23
config_close                                          29      49     +20
find_pair                                            169     187     +18
showmode                                             330     338      +8
hash_find                                            233     234      +1
builtin_umask                                        133     132      -1
lzo1x_optimize                                      1434    1429      -5
test_main                                            253     247      -6
buffer_fill_and_print                                196     179     -17
create_J                                            1849    1826     -23
config_free_data                                      37       -     -37
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 5/5 up/down: 138/-89)            Total: 26 bytes

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agomodprobe: use hash table. speeds up significantly if modprobe.dep is large
Timo Teras [Mon, 20 Jun 2011 07:38:13 +0000 (09:38 +0200)]
modprobe: use hash table. speeds up significantly if modprobe.dep is large

function                                             old     new   delta
helper_get_module                                    106     157     +51
config_file_action                                   413     431     +18
modprobe_main                                        690     706     +16
do_modprobe                                          580     588      +8
add_probe                                             81      83      +2
load_modules_dep                                     192     190      -2
get_or_add_modentry                                   10       -     -10
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 5/1 up/down: 95/-12)             Total: 83 bytes

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agodiff: disable debug code; remove unsupported --dry-run from help text
Denys Vlasenko [Sat, 18 Jun 2011 23:40:31 +0000 (01:40 +0200)]
diff: disable debug code; remove unsupported --dry-run from help text

function                                             old     new   delta
packed_usage                                       28623   28602     -21
do_line                                              121      91     -30
patch_main                                          2086    1923    -163
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-214)           Total: -214 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolibbb/read_cmdline: prepend {comm} if different from argv0. Closes 3835.
Denys Vlasenko [Sat, 18 Jun 2011 13:51:16 +0000 (15:51 +0200)]
libbb/read_cmdline: prepend {comm} if different from argv0. Closes 3835.

function                                             old     new   delta
read_cmdline                                         114     233    +119

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoprocps: remove PSSCAN_STAT define, users were using it incorrectly
Denys Vlasenko [Sat, 18 Jun 2011 13:49:47 +0000 (15:49 +0200)]
procps: remove PSSCAN_STAT define, users were using it incorrectly

Also contains small cleanups ps.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agofix false positive in parse test
Denys Vlasenko [Sat, 18 Jun 2011 07:29:21 +0000 (09:29 +0200)]
fix false positive in parse test

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoparse_config: make test applet easier to enable; fix its code
Denys Vlasenko [Sat, 18 Jun 2011 07:23:09 +0000 (09:23 +0200)]
parse_config: make test applet easier to enable; fix its code

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agolibbb: split bb_get_chunk_from_file and bb_get_chunk_with_continuation
Denys Vlasenko [Fri, 17 Jun 2011 01:37:43 +0000 (03:37 +0200)]
libbb: split bb_get_chunk_from_file and bb_get_chunk_with_continuation

This also moves bb_get_chunk_with_continuation into its sole user,
parse_config.c.
This allows to optimize both functions separately,
they need to be optimized for speed.
(this need was highlighted by slow modprobe caused in part by slow
bb_get_chunk_with_continuation in config parser).

function                                             old     new   delta
bb_get_chunk_from_file                                 7     130    +123
config_read                                          457     558    +101
bb_get_chunk_with_continuation                       194       -    -194
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 2/0 up/down: 224/-194)           Total: 30 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoinetd: check if RPC is available
Bernhard Reutner-Fischer [Wed, 15 Jun 2011 07:38:43 +0000 (09:38 +0200)]
inetd: check if RPC is available

It would be better to have FEATURE_HAVE_RPC be user-selectable and
depend mount.nfs and inetd-rpc on it instead of the current, backward,
way.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agols: fix comment about -p (it's compatible now)
Denys Vlasenko [Mon, 13 Jun 2011 00:24:18 +0000 (02:24 +0200)]
ls: fix comment about -p (it's compatible now)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agols: make -v and -X actually work as intended
Denys Vlasenko [Mon, 13 Jun 2011 00:13:42 +0000 (02:13 +0200)]
ls: make -v and -X actually work as intended

function                                             old     new   delta
strverscmp                                             -     236    +236
sortcmp                                              186     254     +68
static.result_type                                     -      60     +60
static.next_state                                     12      16      +4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoiplink: tweak includes to work on android
Denys Vlasenko [Sun, 12 Jun 2011 15:15:16 +0000 (17:15 +0200)]
iplink: tweak includes to work on android

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agopkill/pgrep: support extended regular expressions
Wade Berrier [Wed, 8 Jun 2011 21:46:55 +0000 (15:46 -0600)]
pkill/pgrep: support extended regular expressions

Done by enabling the REG_EXTENDED and REG_NOSUB regex flags,
which also increases compatibility with the procps versions.

Signed-off-by: Wade Berrier <wade_berrier@appsig.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoReplaced __u32 etc. with standard uint32_t style types
Daniel Fandrich [Thu, 9 Jun 2011 22:44:44 +0000 (15:44 -0700)]
Replaced __u32 etc. with standard uint32_t style types

Signed-off-by: Daniel Fandrich <dfandrich@intrinsyc.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years ago*: simplify Ethernet header includes
Dan Fandrich [Fri, 10 Jun 2011 03:17:59 +0000 (05:17 +0200)]
*: simplify Ethernet header includes

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agobuild system: delete generated files on "make mrproper"
Denys Vlasenko [Tue, 7 Jun 2011 08:01:58 +0000 (10:01 +0200)]
build system: delete generated files on "make mrproper"

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agofbset: apply modelines. Closes 3823
Denys Vlasenko [Mon, 6 Jun 2011 02:21:39 +0000 (04:21 +0200)]
fbset: apply modelines. Closes 3823

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agofix breakage caused by 'remove "Options:" string from help texts' commit
Denys Vlasenko [Sun, 5 Jun 2011 13:07:31 +0000 (15:07 +0200)]
fix breakage caused by 'remove "Options:" string from help texts' commit

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years ago*: remove "Options:" string from help texts
Denys Vlasenko [Sun, 5 Jun 2011 01:58:28 +0000 (03:58 +0200)]
*: remove "Options:" string from help texts

function                                             old     new   delta
packed_usage                                       28706   28623     -83

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoiostat: code shrink
Maksym Kryzhanovskyy [Sun, 5 Jun 2011 01:37:14 +0000 (03:37 +0200)]
iostat: code shrink

function                                             old     new   delta
iostat_main                                         2048    2400    +352
is_partition                                          48       -     -48
print_stats_dev_struct                               350       -    -350

Signed-off-by: Maksym Kryzhanovskyy <xmaks@email.cz>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoudhcpc: allow -O OPT take numeric params
Denys Vlasenko [Sat, 4 Jun 2011 03:07:16 +0000 (05:07 +0200)]
udhcpc: allow -O OPT take numeric params

function                                             old     new   delta
udhcpc_main                                         2623    2654     +31

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoappletlib.c: do not use PAGE_SIZE for malloc tweaking
Denys Vlasenko [Fri, 3 Jun 2011 19:39:42 +0000 (21:39 +0200)]
appletlib.c: do not use PAGE_SIZE for malloc tweaking

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