Commit Graph

1731 Commits

Author SHA1 Message Date
Denys Vlasenko
561f9c8585 Add HAVE_STRVERSCMP, guard the only usage of strverscmp with #ifdef
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-21 16:38:29 +02:00
Denys Vlasenko
8ea683d5df ls: fix comment about -p (it's compatible now)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-13 02:24:18 +02:00
Denys Vlasenko
f194cc1f33 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>
2011-06-13 02:13:42 +02:00
Denys Vlasenko
66426760be *: remove "Options:" string from help texts
function                                             old     new   delta
packed_usage                                       28706   28623     -83

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05 03:58:28 +02:00
Denys Vlasenko
b808614785 od: code shrink
function                                             old     new   delta
od_main                                             2147    2132     -15

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-21 19:15:55 +02:00
Denys Vlasenko
d373355bf8 od: another fix for --strings
function                                             old     new   delta
od_main                                             2139    2147      +8

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-21 18:47:51 +02:00
Denys Vlasenko
9d96e274ce od: fix -S NUM to not print chars >0x80
function                                             old     new   delta
write_block                                          433     431      -2
print_ascii                                          217     215      -2
check_and_close                                      104      96      -8
od_main                                             2164    2139     -25

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-21 18:38:59 +02:00
Denys Vlasenko
3ef344be91 od: code shrink
function                                             old     new   delta
exit_code                                              -       1      +1
open_next_file                                        73      72      -1
limit_bytes_to_format                                  1       -      -1
ioerror                                                1       -      -1
flag_pseudo_start                                      1       -      -1
flag_dump_strings                                      1       -      -1
od_main                                             2275    2164    -111

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-21 18:38:40 +02:00
Denys Vlasenko
5c10fa5c24 od: code shrink, fix "od --traditional FILE"
function                                             old     new   delta
parse_old_offset                                     107     125     +18
packed_usage                                       28715   28691     -24
od_main                                             2312    2275     -37

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-21 17:43:06 +02:00
Denys Vlasenko
9e933d9bfc tail: optimize "tail -c HUGENUM REGULAR_FILE". Closes 3763.
function                                             old     new   delta
tail_main                                           1541    1547      +6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-20 00:30:04 +02:00
Denys Vlasenko
8dd29da2c6 ls: code shrink
function                                             old     new   delta
sort_and_display_files                                 -     427    +427
scan_and_display_dirs_recur                          497     488      -9
ls_main                                              765     735     -30
display_files                                        422       -    -422
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/2 up/down: 427/-461)          Total: -34 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 17:55:08 +02:00
Denys Vlasenko
4029e21b37 ls: reorder and rename functions. No code changes
function                                             old     new   delta
display_single                                         -     931    +931
scan_and_display_dirs_recur                            -     497    +497
display_files                                          -     422    +422
showfiles                                            422       -    -422
showdirs                                             497       -    -497
list_single                                          931       -    -931
------------------------------------------------------------------------------
(add/remove: 3/3 grow/shrink: 0/0 up/down: 1850/-1850)          Total: 0 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 17:28:46 +02:00
Denys Vlasenko
2a81639534 ls: reduce memory consumption and speed up (don't do redundant [l]stat)
function                                             old     new   delta
my_stat                                              110     278    +168
splitdnarray                                         120     118      -2
ls_main                                              769     765      -4
list_single                                          961     931     -30
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 168/-36)           Total: 132 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 17:28:09 +02:00
Denys Vlasenko
66ca241dca ls: avoid forward declaration. No code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 17:27:36 +02:00
Denys Vlasenko
d27ac299eb ls: code shrink
function                                             old     new   delta
list_single                                          990     961     -29

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 17:27:15 +02:00
Denys Vlasenko
279a7ac04e ls: fix help text: -w N is optional
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-12 18:44:51 +02:00
Denys Vlasenko
4ad95e6b0e ls: fix -p help text, improve comments and define names
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-12 18:40:59 +02:00
Denys Vlasenko
43a3d50e14 md5/sha1sum: better fix for small resource leak
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-16 18:56:36 +02:00
Alexey Fomenko
88a8384388 md5/sha1sum: fix small resource leak
Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-16 18:49:39 +02:00
Denys Vlasenko
c13ee8c0f3 basename,dirname,freeramdisk,rx,raidautorun,runsv,chvt: skip "--" argument
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-11 03:58:30 +02:00
Pere Orga
6a3e01d5a9 move help text from include/usage.src.h to debianutils/*.c e2fsprogs/*.c editors/*.c loginutils/*.c mailutils/*.c
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-03 01:33:55 +02:00
Denys Vlasenko
fa9126e689 ls: better help text for -a and -A
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-03 01:27:49 +02:00
Pere Orga
34425389e0 move help text from include/usage.src.h to coreutils/*.c
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-31 14:43:25 +02:00
Alexey Soloviev
f922154f65 dd: free allocated memory if CLEANUP enabled
Signed-off-by: Alexey Soloviev <EXT-Alexey.Soloviev@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-22 17:42:29 +01:00
Denys Vlasenko
b0e8ced358 ln: explain why we use xstrdup
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-21 12:36:35 +01:00
Denys Vlasenko
ea684c6aaf ls: fix handling of symlinks by option -1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-12 03:12:36 +01:00
Pascal Bellard
48b6f59e19 chsum: fix
Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-11 23:40:27 +01:00
Denys Vlasenko
681efe20d3 use user's shell instead of hardwired "/bin/sh" (android needs this)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-08 21:00:36 +01:00
Denys Vlasenko
86cf0364bd printenv: fix environ == NULL segfault
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-08 12:44:02 +01:00
Alexey Soloviev
41478ade4f tr: free allocated memory in tr if CLEANUP enabled
Signed-off-by: Alexey Soloviev <EXT-Alexey.Soloviev@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-06 18:21:07 +01:00
Denys Vlasenko
940c7206c2 convert "do {...} while (1);" -> "while (1) {...}"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-02 04:07:14 +01:00
Denys Vlasenko
3b28dae17d ls: widen -s (1k blocks) column from 4 to 6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-01 05:37:41 +01:00
Denys Vlasenko
26d11b8133 ls: -g implies -l
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-28 12:38:08 +01:00
Denys Vlasenko
9f368e38fb ls: fix bits for -T, -w and --color; make -n imply -l; fix comments
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-28 12:16:10 +01:00
Denys Vlasenko
cd387f2554 ls: fix one-bit-off which caused -H to behave as -h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-27 04:10:00 +01:00
Denys Vlasenko
e3b1a1fd28 Replace "depends on PLATFORM_LINUX" with "select PLATFORM_LINUX"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-26 22:24:08 +01:00
Denys Vlasenko
4fdb67cc65 echo: fix SEGV when run with no args
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-15 18:35:54 +01:00
Denys Vlasenko
b9348440b0 echo: fix ENOSPC detection and some iffy code in \NNN handling
function                                             old     new   delta
echo_main                                            330     302     -28

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-14 15:42:18 +01:00
Denys Vlasenko
8ee2adab21 echo: do not retry on write errors
function                                             old     new   delta
echo_main                                            297     336     +39
stpcpy                                                 -      22     +22
run_pipe                                            1561    1566      +5
pseudo_exec_argv                                     187     192      +5
hush_exit                                             75      80      +5
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 4/0 up/down: 98/0)               Total: 76 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-07 02:03:51 +01:00
Lauri Kasanen
55ae0e9238 df,find_mount_point: optionally don't ignore rootfs
Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-31 06:27:35 +01:00
Denys Vlasenko
df7b6577c6 id: fix inverted if (!ENABLE_DESKTOP)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-26 16:11:19 +01:00
Denys Vlasenko
e3d4c03852 stty: cosmetic fix to settings table; no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-26 11:58:37 +01:00
Denys Vlasenko
ea023eacad disable length applet. ${#var} and echo -n "$var" | wc -c are portable equivalents
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-26 01:21:20 +01:00
Denys Vlasenko
8d0e0cdadf move utmp.h include to libbb.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-25 23:21:46 +01:00
Denys Vlasenko
e54cfc5477 stty: enable line discipline display and change code if __linix__
function                                             old     new   delta
stty_main                                           1242    1276     +34
do_display                                           419     431     +12
display_speed                                         90      81      -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 46/-9)              Total: 37 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-24 18:30:35 +01:00
Denys Vlasenko
271c0ce379 stty: make swtch and iutf8 visible/settable
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-24 16:36:15 +01:00
Denys Vlasenko
1336f89d59 wc: fix swapped -c and -m
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-22 17:57:01 +01:00
Denys Vlasenko
b9f2d9f7d9 mass removal of underscores from _BB_DIR_foo and _BB_SUID_foo
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-18 13:58:01 +01:00
Denys Vlasenko
dc7e5c46b0 libbb unicode: comment out usused function and unused parameter
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-01-11 13:08:28 +01:00
Denys Vlasenko
92ffe0571a date,touch: treat 2-digit years better (fit them into +-50 yrs around today)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-02 20:02:09 +01:00
Alexey Soloviev
a5d3d3436b date: preserve isdst value if date is in time_t (unix time) format
Signed-off-by: Alexey Soloviev <EXT-Alexey.Soloviev@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-31 05:21:51 +01:00
Denys Vlasenko
0cd4f3039b add missed underscore
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-31 00:01:59 +01:00
Denys Vlasenko
d1e46651a3 date: add a comment about _SVID_SOURCE
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-30 23:56:47 +01:00
Denys Vlasenko
27c6c00a7c test: add examples when "%s: unknown operand" happens
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-20 03:43:20 +01:00
James Youngman
a4bc10cec7 ls: remove redundant constants LIST_FILENAME and LIST_SHORT
LIST_FILENAME is always true and LIST_SHORT affects nothing.

Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-20 01:36:16 +01:00
Denys Vlasenko
982aa263a0 ls: add support for -H
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-19 21:54:39 +01:00
Denys Vlasenko
407ab2a434 ls: tweak -e handling; better comments
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-19 16:29:08 +01:00
Denys Vlasenko
2f7d9e8903 ls: print a space after each column. Closes bug 2941
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-19 07:06:44 +01:00
Denys Vlasenko
163d864357 ls: make -F not follow symlinks of the command line
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-19 06:16:28 +01:00
Denys Vlasenko
d87815d5e0 ls: make -x force columnar output; remove unused parts of TRIGGER code
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-19 05:43:44 +01:00
Denys Vlasenko
f313746a6d ls: for some options, only last takes effect. Closes bug 2959
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-12-19 05:05:34 +01:00
Denys Vlasenko
3f2477e8a8 touch: fix help text to not show options disabled in .config
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-12-01 13:06:03 +01:00
Denys Vlasenko
9e0f15010e date :add a comment about older toolchains
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-23 00:15:19 +01:00
Denys Vlasenko
4909fec73e ls: fix -lg to show group (was showing user)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-11-06 00:46:57 +01:00
Eric Lammerts
66be9197a5 stat: fix mtime/ctime/atime
If you set CONFIG_FEATURE_STAT_FORMAT=n, two of the three printed
times are wrong, because a global buffer is reused. Fix below.

Signed-off-by: Eric Lammerts <busybox@lists.lammerts.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-30 02:48:20 +02:00
Denys Vlasenko
fb132e4737 whitespace cleanup
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-29 11:46:52 +02:00
Denys Vlasenko
e4dcba1c10 *: whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 18:57:19 +02:00
Denys Vlasenko
9ce642f974 libbb: introduce and use common crc32 routine
function                                             old     new   delta
crc32_block_endian1                                    -      37     +37
crc32_block_endian0                                    -      34     +34
global_crc32_table                                     -       8      +8
file_read                                             82      87      +5
gzip_main                                            211     214      +3
xz_crc32                                              40      35      -5
crc32_table                                            8       -      -8
calculate_gunzip_crc                                  54      34     -20
lzo_crc32                                             54      25     -29
cksum_main                                           298     211     -87
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 2/4 up/down: 87/-149)           Total: -62 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-27 15:26:45 +02:00
Denys Vlasenko
4c46d85469 mv: implement -n option
function                                             old     new   delta
mv_longopts                                           23      36     +13
mv_main                                              510     520     +10
packed_usage                                       27218   27225      +7

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-26 15:58:47 +02:00
Denys Vlasenko
4b63e16d20 md5/sha1sum: code shrink
function                                             old     new   delta
hash_file                                            357     279     -78

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-24 14:54:53 +02:00
Denys Vlasenko
5360059131 libbb: introduce and use strcpy_and_process_escape_sequences
function                                             old     new   delta
strcpy_and_process_escape_sequences                    -      50     +50
bb_process_escape_sequence                           148     138     -10
printf_main                                          789     776     -13
getty_main                                          1897    1831     -66
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/3 up/down: 50/-89)            Total: -39 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-23 21:06:06 +02:00
Alexander Shishkin
6722737ece *: introduce and use xmkstemp. -65 bytes.
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-22 13:27:16 +02:00
Alexander Shishkin
2348e09557 tail: free tailbuf upon cleaning up
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-21 00:25:45 +02:00
Alexander Shishkin
a7027bf89e stat: remove superfluous setXXent() calls, plug memory leak
function                                             old     new   delta
print_stat                                           875     865     -10

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-21 00:24:05 +02:00
Denys Vlasenko
bec588878b *: s/open3_or_warn/open_or_warn/ where makes sense
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-20 13:21:22 +02:00
Denys Vlasenko
5fe2f863b9 sort: -o FILE should create/truncate FILE
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-18 02:43:57 +02:00
Denys Vlasenko
c05387d5de *: replace xopen3 with xopen where makes sense
function                                             old     new   delta
uniq_main                                            421     416      -5
sort_main                                            803     798      -5
patch_main                                          2051    2046      -5
cpio_main                                            547     542      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-18 02:38:27 +02:00
Denys Vlasenko
ea694163af typo fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 12:45:24 +02:00
Denys Vlasenko
786635e62e seq: exit on write errors
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-17 12:44:39 +02:00
Denys Vlasenko
c0683acce8 *: pass md5/shaN context pointer as 1st arg, not last
function                                             old     new   delta
md5_hash_block                                       458     459      +1
filter_rename_config                                 252     250      -2
md5_crypt                                            591     587      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-16 20:45:27 +02:00
Denys Vlasenko
f2710d0221 date: move applet and usage bits to date.c
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-15 10:42:17 +02:00
Denys Vlasenko
afc7b4c0d8 wc: add support for -m
function                                             old     new   delta
wc_main                                              601     637     +36
packed_usage                                       27357   27358      +1

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-04 17:08:14 +02:00
Denys Vlasenko
09e7dafbfe wc: preparatory patch, no logic changes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-04 17:04:20 +02:00
Dan Fandrich
2d1a78b88f Marked some more applets NOEXEC/NOFORK
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-01 23:35:09 +02:00
Denys Vlasenko
04bcd998ca style fix. no code chages
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-09-25 17:19:04 +02:00
Denys Vlasenko
0f2e278a8a sleep: fix fractional arguments in non-POSIX locale
function                                             old     new   delta
sleep_main                                           390     379     -11

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-24 12:39:45 +02:00
Denys Vlasenko
9fe98f701d libbb: merge mail and uudecode's base64 decoders
function                                             old     new   delta
read_base64                                            -     378    +378
uudecode_main                                        306     315      +9
parse                                                953     958      +5
read_stduu                                           250     254      +4
base64_main                                          217     219      +2
read_base64                                          358       -    -358
decode_base64                                        371       -    -371
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 4/0 up/down: 398/-729)         Total: -331 bytes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-16 17:51:13 +02:00
Denys Vlasenko
197a6b3c14 sleep: make it non-NOFORK. Fixes ^C in standalone shell
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-14 12:57:05 +02:00
Dan Fandrich
77d4872691 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>
2010-09-09 11:48:02 +02:00
Denys Vlasenko
6f80fe71f0 uudecode,base64: code shrink
function                                             old     new   delta
read_base64                                          373     358     -15

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-01 13:24:05 +02:00
Denys Vlasenko
ee06264a29 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>
2010-08-31 14:09:22 +02:00
Denys Vlasenko
b32a543663 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>
2010-08-29 13:29:02 +02:00
Denys Vlasenko
7ff6836db3 split: use xopen_stdin()
function                                             old     new   delta
split_main                                           558     543     -15

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-23 03:06:46 +02:00
Denys Vlasenko
0ef64bdb40 *: 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>
2010-08-16 20:14:46 +02:00
Denys Vlasenko
9768a82eb0 *: fix "see file License ..." - the file is named LICENSE (in uppercase)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-16 03:04:14 +02:00
Denys Vlasenko
7783248eaa *: s/xatoi_u/xatoi_positive/g - I got bored of mistyping xatoi_u as xatou_i
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-12 14:14:45 +02:00
Jeremie Koenig
138ce54c9c stty: sort out preprocessor conditionals
* Move the definitions of missing constants to the top of the file.
* Fix undefined IDX_xxx on missing termios constants.
* FreeBSD has TABDLY, TAB0 and TAB3, but no TAB1 or TAB2
* Omit the definition of set_window_size() if TIOCGWINSZ is not available.

Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-01 03:31:35 +02:00
Denys Vlasenko
f3ea792bad *: mass cosmetic removal of extra empty lines. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-26 01:06:14 +02:00
Jeremie Koenig
1d7266d3b5 mark Linux-specific configuration options
PLATFORM_LINUX is used as a dependency for applets or features
which require Linux-specific interfaces.

Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-19 00:44:56 +02:00
Jeremie Koenig
b175462422 readlink: use xmalloc_realpath()
Using realpath() directly with a non-NULL output buffer is unsafe because its
behavior is unspecified on systems which don't have PATH_MAX (ie. Hurd)

I beleive this also fixes a small bug whereby 'buf' would not be freed
on 'readlink -v' with ENABLE_FEATURE_CLEANUP.

Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-19 00:43:05 +02:00
Denys Vlasenko
d1516c4d62 dos2unix: fix the case w/o parameters
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-17 22:43:42 +02:00
Denys Vlasenko
8f65b0cf31 whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-06 18:46:02 +02:00
Pascal Bellard
21e8e8da64 libbb: introduce and use BB_EXECVP_or_die()
function                                             old     new   delta
BB_EXECVP_or_die                                       -      47     +47
time_main                                           1042    1043      +1
chrt_main                                            371     364      -7
ionice_main                                          292     282     -10
setsid_main                                           69      56     -13
nohup_main                                           236     223     -13
cttyhack_main                                        266     253     -13
chroot_main                                           94      81     -13
chpst_main                                           746     733     -13
timeout_main                                         297     279     -18
taskset_main                                         541     522     -19
vfork_child                                           67      45     -22
parse                                                975     953     -22
lpd_main                                             770     748     -22
launch_helper                                        192     170     -22
tcpudpsvd_main                                      1810    1782     -28
nice_main                                            190     156     -34
env_main                                             242     206     -36
run_command                                          221     174     -47
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/17 up/down: 48/-352)         Total: -304 bytes

Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-04 00:57:03 +02:00
Denys Vlasenko
41ddd9f606 *: make exec failure message more consistent
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-25 01:46:53 +02:00
Denys Vlasenko
4ebdae3777 date: make %N work without -lrt on glibc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18 02:55:48 +02:00
Seb
d2d327db6d stat: make output more similar to GNU stat
Signed-off-by: Seb <sbb@tuxfamily.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-12 21:57:50 +02:00
Denys Vlasenko
e2b41cfb4b date: trivial fix - was reading seconds into nanoseconds field! DOH
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-12 03:32:22 +02:00
Denys Vlasenko
d70e0e995e *: add INSERTs to *.src files where appropriate
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-08 12:15:11 +02:00
Denys Vlasenko
b68bba5649 date: use the same code for FEATURE_DATE_NANO for glibc and uclibc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-08 04:39:30 +02:00
Denys Vlasenko
729ecb87bf bbconfig: make it independent from printf functions
function                                             old     new   delta
full_write2_str                                        -      25     +25
full_write1_str                                        -      25     +25
clear_main                                            21      20      -1
telnet_main                                         1488    1477     -11
getty_main                                          1932    1918     -14
full_write22_str                                      25       -     -25
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 0/3 up/down: 50/-51)             Total: -1 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-07 14:14:26 +02:00
Denys Vlasenko
f2da16f451 date: make FEATURE_NANO compile on glibc systems
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 17:53:48 +02:00
Denys Vlasenko
f2177abe1d yes: this applet doesn't have options, don't lie that it does.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 05:23:09 +02:00
Denys Vlasenko
2f32bf8be6 remove defconfig. Now "make defconfig" simply uses defaults from Config.in
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 04:14:28 +02:00
Denys Vlasenko
729ce47360 tr: add forgotten //config: prefixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-05 21:29:41 +02:00
Denys Vlasenko
da929a95aa mass renaming Kbuild -> Kbuild.src, Config.in -> Config.src
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-04 20:10:51 +02:00
Denys Vlasenko
e4070cb0d7 partially migrate coreutils to Config.src and Kbuild.src
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-04 19:59:49 +02:00
Denys Vlasenko
6c2406ac86 date: optional support for %N. Closes bug 1861.
function                                             old     new   delta
date_main                                            862    1090    +228
clock_gettime                                          -      41     +41
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/0 up/down: 269/0)             Total: 269 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-04 18:19:15 +02:00
Denys Vlasenko
3e47cfec90 test: "" is not a valid number. Closes bug 1915
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-03 01:47:04 +02:00
Denys Vlasenko
ea8b252cb3 *: better string sharing
text   data    bss    dec    hex filename
 849427    441   7556 857424  d1550 busybox_old
 849355    441   7556 857352  d1508 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-02 12:57:26 +02:00
Denys Vlasenko
b9542cb2ce deinline two big functions
function                                             old     new   delta
xz_dec_lzma2_run                                       -    1483   +1483
decode_one_format                                      -     715    +715
decode_format_string                                 840      98    -742
unpack_xz_stream                                    4014    2377   -1637
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/2 up/down: 2198/-2379)       Total: -181 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-01 23:16:46 +02:00
Denys Vlasenko
ff0e875e02 work on adding testsuite runs to randomconfig test builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-10 04:16:43 +02:00
Denys Vlasenko
6dbbac5d4f Move utmp/wtmp support to "General configuration" section
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-06 18:48:32 +02:00
Denys Vlasenko
37f5bef63c libbb: split update_utmp from login/getty in preparation to use it for telnetd
function                                             old     new   delta
update_utent                                           -     339    +339
login_main                                          1498    1128    -370
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 339/-370)          Total: -31 bytes

function                                             old     new   delta
update_utmp                                          246     337     +91
login_main                                          1128    1140     +12
getty_main                                          1908    1918     +10
...
update_utent                                         339       -    -339
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 5/6 up/down: 119/-368)         Total: -249 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-05 03:18:40 +02:00
Denys Vlasenko
4c721049c3 who: fix attempts to open '/dev/dev/ttyX'; make columns a bit wider, add -H
function                                             old     new   delta
who_main                                             292     363     +71

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-04 23:45:09 +02:00
Jérémie Koenig
fbedacfc8c Hurd compat fixes. Mostly dealing with absent PATH_MAX
Signed-off-by: Jérémie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 19:08:53 +01:00
Denys Vlasenko
19158a837d unicode: s/FEATURE_ASSUME_UNICODE/UNICODE_SUPPORT, add UNICODE_USING_LOCALE
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 14:06:56 +01:00
Tomas Heinrich
968951fd0c unexpand: fix "a b"\n" input case
Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 09:46:07 +01:00
Tomas Heinrich
1abc07dcca [un]expand: account for different character widths. +16 bytes.
Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-26 09:40:47 +01:00
Denys Vlasenko
651a2697f7 *: merge some common strings
text   data    bss    dec    hexfilename
 838650   8009      0 846659  ceb43busybox_old
 838519   8009      0 846528  ceac0busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-23 16:25:17 +01:00
Mikhail Gusarov
927e4bb644 touch: do not ignore argument of -d/-t option
Previously -d/-t was no-op due to wrong handling of args passed to
utimes(2).

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-21 13:04:47 +01:00
Denys Vlasenko
6eaeb7737d tailk: fix error detected by testsuite
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-12 22:16:25 +01:00
Denys Vlasenko
79950a6bbe wc: compat: make "wc -c ONE_FILE" not print leading spaces. +2 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-08 22:03:24 +01:00
Denys Vlasenko
5749328b56 head,tail: trim help text; make suffixes unconditional for head too
function                                             old     new   delta
packed_usage                                       26411   26375     -36

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-02 16:18:14 +01:00
Bernhard Reutner-Fischer
836f36333a tail: document FANCY flags in helptext
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-26 18:34:16 +01:00
Bernhard Reutner-Fischer
1359e0d1b9 df: explain FANCY options in helptext
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-26 18:21:42 +01:00
Denys Vlasenko
43d9747f6e install: strip before mode/uid/gid is set, not after.
function                                             old     new   delta
install_main                                         694     716     +22
basename                                              21       -     -21

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-21 16:55:29 +01:00
Denys Vlasenko
10544a8410 compat and warning fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-09 00:26:10 +01:00
Denys Vlasenko
3205c24a82 shaNNNsum: accept and ignore -b and -t
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-07 23:28:23 +01:00
Denys Vlasenko
cb7edc2661 adduser: copy /etc/skel to mew homes. +100 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-06 21:50:59 +01:00
Denys Vlasenko
0cd445f4d1 cosmetic fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-06 21:11:49 +01:00
Denys Vlasenko
98a4c7cf3d *: suppress ~60% of "aliased warnings" on gcc-4.4.1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-04 15:00:15 +01:00
Denys Vlasenko
5b9b1365a0 stat: get rid on intmax_t
function                                             old     new   delta
print_it                                             225     218      -7
print_stat                                           919     889     -30
print_statfs                                         370     339     -31
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-68)             Total: -68 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-02 03:08:57 +01:00
Denys Vlasenko
d8528b8e56 ls: unicode fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-31 05:15:38 +01:00
Denys Vlasenko
ed910c750d cal: add a unicode test
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-31 00:10:18 +01:00
Denys Vlasenko
e17764c8fb further work on unicodization
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-30 23:16:21 +01:00
Denys Vlasenko
6b9f163353 *: style fixes. no code changes (verified with objdump)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-28 02:24:24 +01:00
Denys Vlasenko
6b01b71e83 randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-24 22:52:21 +01:00
Denys Vlasenko
9f93d62192 libbb: better unicode width support. Hopefully fixes bug 839.
Also opens up a possibility to make other unicode stuff smaller
and more correct later. but:

function                                             old     new   delta
static.combining                                       -     516    +516
bb_wcwidth                                             -     328    +328
unicode_cut_nchars                                     -     141    +141
mbstowc_internal                                       -      93     +93
in_table                                               -      78     +78
cal_main                                             899     961     +62
static.combining0x10000                                -      40     +40
unicode_strlen                                         -      31     +31
bb_mbstrlen                                           31       -     -31
bb_mbstowcs                                          173     102     -71
------------------------------------------------------------------------------
(add/remove: 7/1 grow/shrink: 1/1 up/down: 1289/-102)        Total: 1187 bytes

Uses code of Markus Kuhn, which is in public domain:
http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
"Permission to use, copy, modify, and distribute this software
 for any purpose and without fee is hereby granted. The author
 disclaims all warranties with regard to this software."

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-24 07:44:03 +01:00
Denys Vlasenko
5da9f96ad8 date: introduce FEATURE_DATE_COMPAT; shrink
function                                             old     new   delta
date_main                                            889     862     -27

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-23 23:37:52 +01:00
Denys Vlasenko
9882b34fe2 chown: -2 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-23 00:13:32 +01:00
Matheus Izvekov
31416d589e chown: support long options
function                                             old     new   delta
chown_longopts                                         -      81     +81
chown_main                                           182     192     +10

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-23 00:10:40 +01:00
Denys Vlasenko
7be97c5b6b ls: fix sort of very large files. +21 byte
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-18 13:02:27 +01:00
Denys Vlasenko
573ba4e92e fix examples which used non-standard cut -b0-NNN
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-18 12:25:09 +01:00
Denys Vlasenko
9c3b84a304 ls: make it so that group never glues itself to file size
+ smaller enhancements: inode is long long; -h is a bit narrower; etc

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-18 01:55:00 +01:00
Denys Vlasenko
a40f0624db cp: fix -H handling
function                                             old     new   delta
copy_file                                           1495    1518     +23

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-15 22:05:07 +01:00
Denys Vlasenko
bb16f57e5d INSTALL: update obsolete doc, as suggested by Doug Clapp (doug.clapp AT triad.rr.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-13 22:43:13 +01:00
Denys Vlasenko
c041e239db fix configure sha256sum problem. Closes bug 895
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-13 18:55:37 +01:00
Denys Vlasenko
dc698bb038 *: make it easier to distinquish "struct tm", pointer to one, etc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-09 19:10:49 +01:00
Denys Vlasenko
86350f8d5f cal: document the location of unicode bug. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-06 10:18:37 +01:00
Denys Vlasenko
28055028a7 fold: unicode support. Based on a patch by Tomas Heinrich <heinrich.tomas@gmail.com>
General Unicode support is tweaked to expose unicode_status.

function                                             old     new   delta
init_unicode                                           -      77     +77
write2stdout                                           -      19     +19
adjust_column                                         68      71      +3
unicode_status                                         -       1      +1
unicode_is_enabled                                     1       -      -1
grep_main                                            780     773      -7
fold_main                                            619     552     -67
check_unicode_in_env                                  77       -     -77
------------------------------------------------------------------------------
(add/remove: 3/2 grow/shrink: 1/2 up/down: 100/-152)          Total: -52 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 20:49:58 +01:00
Tomas Heinrich
d2b1ba6fde [un]expand: unicode support
function                                             old     new   delta
expand_main                                          633     663     +30

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 16:21:31 +01:00
Denys Vlasenko
2ec91aead5 *: remove some uses of argc
function                                             old     new   delta
whoami_main                                           34      37      +3
logname_main                                          60      63      +3
hostid_main                                           35      38      +3
ttysize_main                                         136     135      -1
nmeter_main                                          673     672      -1
logger_main                                          387     386      -1
uuencode_main                                        330     328      -2
ifupdown_main                                       2125    2123      -2
mesg_main                                            158     155      -3
free_main                                            333     330      -3
cal_main                                             902     899      -3
acpid_main                                           443     440      -3
ar_main                                              196     189      -7
find_main                                            476     467      -9
ifconfig_main                                       1235    1221     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/12 up/down: 9/-49)            Total: -40 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 14:15:38 +01:00
Denys Vlasenko
a355da0775 *: make 2 more "int argc"'s unused; more saved if !DESKTOP
function                                             old     new   delta
sync_main                                             18      20      +2
tty_main                                              90      87      -3
iprule_list                                           83      79      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 13:16:08 +01:00
Denys Vlasenko
aa42d13e32 sort: make sort -o FILE FILE (same FILE) work. Closes bug 785. -3 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-13 02:09:22 +01:00
Denys Vlasenko
800ff7cc75 stty: code shrink -44 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-11 15:00:17 +01:00
Denys Vlasenko
9f5a577a32 stty: fix columns command. closes bug 791.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-11 14:17:02 +01:00
Denys Vlasenko
a7329667b4 mount: prevent second mount -a from mounting everything again
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-05 04:25:19 +01:00
Denys Vlasenko
d0f9d0ed58 touch: needs another fix after last utimes() fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-30 11:36:14 +01:00
Denys Vlasenko
dcbfaba264 fix improper utimes usage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-29 19:40:36 +01:00
Denys Vlasenko
e992bae6f9 *: remove a few more cases of argc usage. -89 bytes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-28 15:18:53 +01:00
Denys Vlasenko
5b6fe34cee split: handle - as "use stdin". +13 bytes. Closes bug 741.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-26 05:43:16 +01:00
Denys Vlasenko
11f3a8b7ed od: fix -tx without length spec
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-22 15:37:16 +01:00
Denys Vlasenko
c270454f8f fix fallout from isprint() changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-20 19:14:19 +01:00
Denys Vlasenko
8684cbb5cc libbb: robustify isXXXX(). +39 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-18 11:34:43 +01:00
Dan Fandrich
5b0a7f1a6e wc: fix a hang gue to isprint(EOF)
The new isprint replacement macro returns TRUE for isprint(EOF), so the
read loop never returns. Moved the check for EOF immediately after the
read.

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-18 10:48:09 +01:00
Denys Vlasenko
a7ccdeef39 libbb: added xfdopen_for_read/write
function                                             old     new   delta
xfdopen_helper                                         -      40     +40
logdir_open                                         1163    1184     +21
process_stdin                                        433     443     +10
xfdopen_for_write                                      -       9      +9
doCommands                                          2465    2474      +9
patch_main                                          1214    1222      +8
bbunpack                                             457     465      +8
xfdopen_for_read                                       -       7      +7
scan_tree                                            258     262      +4
xstrtoul_range_sfx                                   230     231      +1
sendmail_main                                        957     955      -2
passwd_main                                         1027    1023      -4
parse                                                969     964      -5
test_main                                            253     247      -6
sed_main                                             655     649      -6
dos2unix_main                                        437     429      -8
fbsplash_main                                        950     938     -12
handle_dir_common                                    371     354     -17
expand_vars_to_list                                 2197    2169     -28
update_passwd                                       1275    1246     -29
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 7/10 up/down: 117/-117)           Total: 0 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15 23:28:11 +01:00
Denys Vlasenko
ff1822aed1 date: restore hadling of MMDDhhmm[[CC]YY][.ss] date format
function                                             old     new   delta
date_main                                            698     889    +191

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15 04:55:40 +01:00
Denys Vlasenko
389cca4b9e some non-gnu compilers can't have non-const struct initializers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15 02:28:56 +01:00
Bernhard Reutner-Fischer
a307af1af6 use utimes() rather than obsolescent utime()
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-15 00:12:53 +01:00
Denys Vlasenko
6331cf059c *: use "can't" instead of "cannot"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-13 09:08:27 +01:00
Denys Vlasenko
f4fee418ae env: don't SEGV on bare "env -"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-12 14:52:47 +01:00
Denys Vlasenko
ab19ede655 tidy up O_NONBLOCK usage. use libbb functions in stty.
Added O_RDONLY where improves readability. Note: O_RDONLY == 0,
so it is there even if not specified.

function                                             old     new   delta
stty_main                                           1289    1235     -54

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-11 21:05:42 +01:00
Denys Vlasenko
ded688c6f6 fold: fix a corner case. By Tomas Heinrich (heinrich.tomas AT gmail.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-04 15:31:19 +01:00
Denys Vlasenko
8131eea3dc *: introduce and use ffulsh_all()
function                                             old     new   delta
buffer_fill_and_print                                179     196     +17
fflush_all                                             -       9      +9
spawn                                                 87      92      +5
rtcwake_main                                         455     453      -2
...
alarm_intr                                            93      84      -9
readcmd                                             1072    1062     -10
bb_ask                                               345     333     -12
more_main                                            845     832     -13
flush_stdout_stderr                                   42      23     -19
xfflush_stdout                                        27       -     -27
flush_stderr                                          30       -     -30
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397)         Total: -366 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-02 14:19:51 +01:00
Bernhard Reutner-Fischer
95a036e125 tty: use defines rather than constants
No obj-code changes.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-10-29 21:37:48 +01:00
Bernhard Reutner-Fischer
a48308701a add and use xopen_nonblocking (-18b)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-27 17:17:34 +01:00
Denys Vlasenko
0939f2ebd2 fix up potential printf's with unsafe format strings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-24 17:47:56 +02:00
Denys Vlasenko
d93fc61725 ls: fix "ls | cat" to not show "total NNN" header
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-23 16:22:25 +02:00
Bernhard Reutner-Fischer
ca22cda709 date: handle long options
RFC2822 obsoletes RFC822; Silently accept --rfc-822 and return rfc2822
output for compatibility.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-10-23 16:07:37 +02:00
Denys Vlasenko
f2cbb03a37 *: optimize most of isXXXXX() macros
text    data     bss     dec     hex filename
 824164     453    6812  831429   cafc5 busybox_old
 823730     453    6812  830995   cae13 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-23 03:16:08 +02:00
Denys Vlasenko
c0dab37d0a *: remove last function calls to isspace
function                                             old     new   delta
xstrtoul_range_sfx                                   232     231      -1
xstrtoull_range_sfx                                  295     293      -2
trim                                                  82      80      -2
trim_trailing_spaces_and_print                        57      52      -5
isspace                                               18       -     -18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-22 22:28:08 +02:00
Denys Vlasenko
a46317b6f3 df: trivial 64-bit fix
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-21 23:28:20 +02:00
Denys Vlasenko
7eabffafa5 dd: use correct multiplication factor and simplify code
function                                             old     new   delta
dd_output_status                                     332     364     +32

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-14 17:43:41 +02:00
Denys Vlasenko
a1a3972f28 dd: add a comment, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-14 00:49:06 +02:00
Gabor Heja
4e5b07b0fe dd: speed measurement. optional.
function                                             old     new   delta
dd_output_status                                      68     289    +221
dd_main                                             1463    1482     +19
write_and_stats                                       64      75     +11
packed_usage                                       26529   26526      -3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 251/-3)            Total: 248 bytes
Signed-off-by: Gabor Heja <kakaopor@kakaopor.hu>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-14 00:29:28 +02:00
Denys Vlasenko
0bf44d00a4 libbb/human_readable.c: shrink; and reduce bss usage
also, move smart_ulltoaN there and comment usage locations

function                                             old     new   delta
static.unit_chars                                      7       9      +2
utoa_to_buf                                          110     108      -2
make_human_readable_str                              262     258      -4
fallbackSort                                        1723    1719      -4
static.fmt                                            97      92      -5
static.fmt_tenths                                     10       -     -10
static.str                                            21       4     -17
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/5 up/down: 2/-42)             Total: -40 bytes
   text    data     bss     dec     hex filename
 820981     453    6932  828366   ca3ce busybox_old
 820968     453    6916  828337   ca3b1 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-13 01:25:09 +02:00
Denys Vlasenko
d5fddcd57f cp: revert a recent buggy change, and add a comment why it's wrong
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 01:32:44 +02:00
Denys Vlasenko
7bb346f23c *: use {i,u}toa() where appropriate
function                                             old     new   delta
startservice                                         377     363     -14
setari_u                                              54      40     -14
ash_main                                            1375    1361     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-42)             Total: -42 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-06 22:09:50 +02:00
Denys Vlasenko
1d63f046d0 ls: forgotten chunk from prev commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 11:45:07 +02:00
Denys Vlasenko
cae409c6aa ls: code shrink
function                                             old     new   delta
count_dirs                                            81      86      +5
dnalloc                                               13      17      +4
showfiles                                            372     370      -2
ls_main                                              833     825      -8
showdirs                                             505     489     -16
splitdnarray                                         189     120     -69
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/4 up/down: 9/-95)             Total: -86 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-03 11:43:48 +02:00