Commit Graph

1228 Commits

Author SHA1 Message Date
Denis Vlasenko
dc4ab54ea7 test: fix thinko in previous commit 2007-06-08 07:59:54 +00:00
Denis Vlasenko
89bca27158 test: recognize /path/to/[ case too 2007-06-08 07:33:45 +00:00
Bernhard Reutner-Fischer
1622cb8cea - i need this disabled code for testing a patch. Please leave it in. 2007-06-07 12:11:24 +00:00
Bernhard Reutner-Fischer
e8b2bd4d47 - fix wrong not operator which was essentially ignored. got introduced in r18282
http://busybox.net/lists/busybox/2007-June/027652.html
2007-06-06 19:27:58 +00:00
Denis Vlasenko
ae5a8aac26 awk: move all data to malloc space
function                                             old     new   delta
evaluate                                            6448    6728    +280
awk_getline                                          676     705     +29
parse_expr                                           726     752     +26
next_token                                           917     943     +26
next_input_file                                      237     252     +15
awk_split                                            498     510     +12
awk_sub                                              632     643     +11
split_f0                                             160     170     +10
getvar_s                                              98     108     +10
...
chain_loop                                           128     121      -7
nvalloc                                              179     171      -8
chain_node                                           107      99      -8
mainseq                                               12       -     -12
endseq                                                12       -     -12
chain_group                                          640     628     -12
beginseq                                              12       -     -12
awk_exit                                             112     100     -12
fsrealloc                                            127     110     -17
static.v                                              20       -     -20
static.rsm                                            24       -     -24
ttt                                                   28       -     -28
parse_program                                        339     311     -28
static.sreg                                           32       -     -32
intvar                                                76       -     -76
static.tspl                                           84       -     -84
rsplitter                                             84       -     -84
fsplitter                                             84       -     -84
------------------------------------------------------------------------------
(add/remove: 0/39 grow/shrink: 16/11 up/down: 439/-685)      Total: -246 bytes
2007-06-06 17:01:00 +00:00
Denis Vlasenko
c084d2f205 echo: fix non-fancy echo 2007-06-06 07:50:51 +00:00
Denis Vlasenko
746204b1b8 uudecode: fix to base64 decode by Jorgen Cederlof <jcz@google.com>
improved help texts

# make bloatcheck
function                                             old     new   delta
.rodata                                           127000  127032     +32
packed_usage                                       22156   22151      -5
uudecode_main                                        360     348     -12
uuencode_main                                        490     468     -22
read_base64                                          283     254     -29
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/4 up/down: 32/-68)            Total: -36 bytes
2007-06-04 23:32:35 +00:00
Denis Vlasenko
ef4bb26f93 diff: stop using data/bss
function                                             old     new   delta
do_diff                                              385     436     +51
diff_main                                            850     895     +45
dump_unified_vec                                     437     457     +20
prepare                                              335     334      -1
anychange                                              1       -      -1
suff                                                   4       -      -4
status                                               135     131      -4
static.max_context                                     4       -      -4
start                                                 12       8      -4
pref                                                   4       -      -4
member                                                 4       -      -4
label2                                                 4       -      -4
label1                                                 4       -      -4
klist                                                  4       -      -4
ixold                                                  4       -      -4
ixnew                                                  4       -      -4
dl_count                                               4       -      -4
dl                                                     4       -      -4
context_vec_start                                      4       -      -4
context_vec_ptr                                        4       -      -4
context_vec_end                                        4       -      -4
context                                                4       -      -4
clistlen                                               4       -      -4
clist                                                  4       -      -4
clen                                                   4       -      -4
class                                                  4       -      -4
J                                                      4       -      -4
add_to_dirlist                                        71      64      -7
slen                                                   8       -      -8
sfile                                                  8       -      -8
len                                                    8       -      -8
file                                                   8       -      -8
get_dir                                              196     185     -11
newcand                                               97      85     -12
change                                               351     331     -20
stb2                                                  96       -     -96
stb1                                                  96       -     -96
diffreg                                             2835    2717    -118
------------------------------------------------------------------------------
(add/remove: 0/27 grow/shrink: 3/8 up/down: 116/-482)        Total: -366 bytes

# size */*/diff.o
   text    data     bss     dec     hex filename
   7055       8     305    7368    1cc8 busybox.t2/coreutils/diff.o
   7002       0       0    7002    1b5a busybox.t3/coreutils/diff.o
2007-06-04 12:21:53 +00:00
Denis Vlasenko
74324c8666 Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
2007-06-04 10:16:52 +00:00
Denis Vlasenko
9a7d38fe24 delete tons of extra #includes 2007-05-31 22:42:12 +00:00
Denis Vlasenko
fad2b86c9e use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228)        Total: -89 bytes
2007-05-31 22:16:38 +00:00
Denis Vlasenko
4b924f3a5c whitespace fixes 2007-05-30 00:29:55 +00:00
Denis Vlasenko
fe3e1776ad test: close bug 1371
test: plug a memory leak
2007-05-27 03:39:50 +00:00
Denis Vlasenko
b6adbf1be2 usage.c: remove reference to busybox.h
*: s/include "busybox.h"/include "libbb.h"
2007-05-26 19:00:18 +00:00
Denis Vlasenko
6d709972cd cttyhack: new applet. 2007-05-18 09:45:36 +00:00
Denis Vlasenko
5b34083004 several *.c files:
move 'extern environ' up to the location of #includes
2007-05-17 23:02:14 +00:00
Denis Vlasenko
92c0b8222e tail: fix SEGV on "tail -N"
config system: clarify PREFER_APPLETS/SH_STANDALONE effects in help text
2007-05-08 17:27:17 +00:00
Denis Vlasenko
dcf4de20a1 test: code size saving, no logic changes
ps: fix warning, make a bit smaller
kill -l: make smaller & know much more signals

function                                             old     new   delta
get_signum                                           121     153     +32
kill_main                                            826     843     +17
get_signame                                           44      36      -8
signals                                              252     224     -28
.rodata                                           131955  131923     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/3 up/down: 49/-68)            Total: -19 bytes
2007-05-01 20:07:29 +00:00
Denis Vlasenko
a6a1785a30 hush: add ctrl-Z handling for nofork'ed case 2007-04-28 16:42:11 +00:00
Denis Vlasenko
f6250a3bee dd: NOEXEC fix
dd: correct wrongly capitalized constant
2007-04-19 20:16:14 +00:00
Denis Vlasenko
d1801a4430 dd: fix skip= parse error (spotted by Dirk Clemens <develop@cle-mens.de>) 2007-04-19 20:08:19 +00:00
Denis Vlasenko
9ace613406 stty: fix option parsing bug (spotted by Sascha Hauer <s.hauer@pengutronix.de>) 2007-04-19 19:55:54 +00:00
Denis Vlasenko
ac678ec2f1 style fixes, no code changes 2007-04-16 22:32:04 +00:00
Bernhard Reutner-Fischer
e468ef27b7 - fix compilation if ENABLE_FEATURE_DD_IBS_OBS is off 2007-04-16 12:21:05 +00:00
Denis Vlasenko
16abcd90ae teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
2007-04-13 23:59:52 +00:00
Denis Vlasenko
87468857f6 style fixes 2007-04-13 23:22:00 +00:00
Denis Vlasenko
51742f4bb0 style fixes. No code changes 2007-04-12 00:32:05 +00:00
Denis Vlasenko
50f7f446ec bb_full_fd_action: remove potential xmalloc from NOFORK path
cat: stop using stdio.h opens
libbb: introduce & use open[3]_or_warn
function                                             old     new   delta
open3_or_warn                                          -      54     +54
bb_cat                                               115     144     +29
open_or_warn                                           -      25     +25
unlzma                                              2404    2412      +8
chattr_main                                          334     339      +5
xstrtoul_range_sfx                                   251     255      +4
telnet_main                                         1514    1510      -4
static.opt                                             4       -      -4
qgravechar                                           122     118      -4
fuser_add_pid                                         61      54      -7
fuser_add_inode                                      154     147      -7
writeFileToTarball                                  1542    1534      -8
refresh                                             1156    1148      -8
do_show                                              856     846     -10
read_leases                                          212     200     -12
setup_redirects                                      236     222     -14
iproute_list_or_flush                               1582    1568     -14
read_config                                          427     411     -16
write_leases                                         284     264     -20
hash_file                                            338     318     -20
copy_file                                           1760    1740     -20
do_iproute                                          2610    2588     -22
bb_full_fd_action                                    320     269     -51
open_to_or_warn                                      103      49     -54
fuser_main                                          1660    1596     -64
.rodata                                           131160  131096     -64
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 4/19 up/down: 125/-423)        Total: -298 bytes
2007-04-11 23:20:53 +00:00
Denis Vlasenko
c6758a07c6 make compressed help code NOMMU- and NOFORK-friendly -
no forking anymore, bunzip2 unpack routine now does all it in memory.
2007-04-10 21:40:19 +00:00
Denis Vlasenko
335b63d8d1 make a few struct bb_applet members conditional
rename sllep_and_die -> xfunc_die
make fflush_stdout_and_exit NOFORK-safe
fix some buglets found by randomconfig
2007-04-10 21:38:30 +00:00
Bernhard Reutner-Fischer
99003b8a87 - use enum for the OPs as suggested by vda. No obj-code changes. 2007-04-10 19:30:50 +00:00
Denis Vlasenko
a9d7d24e1f echo: fix regression ("echo" with no arguments didn't print newline.
echo: use fputs if no options are given. Code growth ~15 bytes.

Old:
# time ./busybox find $bigdir -exec echo {} \; >/dev/null
real    0m2.038s
user    0m0.761s
sys     0m0.953s

New:
# time ./busybox find $bigdir -exec echo {} \; >/dev/null
real    0m1.781s
user    0m0.781s
sys     0m0.939s

For comparison: without NOFORK:
# time find $bigdir -exec echo {} \; >/dev/null
real    1m51.129s
user    0m38.442s
sys     1m3.350s
2007-04-10 16:34:00 +00:00
Denis Vlasenko
99912ca733 audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
2007-04-10 15:43:37 +00:00
Denis Vlasenko
ff131b980d style fixes. No code changes. 2007-04-10 15:42:06 +00:00
Bernhard Reutner-Fischer
de17ece1db - use skip_non_whitespace() where appropriate 2007-04-10 09:38:35 +00:00
Denis Vlasenko
3f3aa2a57d make xfunctions optionally longjump instead of exit.
use it for making NOFORK more practical.
touch: make it a NOFORK applet
2007-04-09 21:35:07 +00:00
Denis Vlasenko
7e754f12d3 Implement first instance of NOFORK applet - echo
find: use NOFORK/NOEXEC; small -exec buglet also eliminated
vfork_daemon_rexec: honor PREFER_APPLETS
echo: small size improvements

find -exec echo {} \; with PREFER_APPLETS=y runs 4 times faster
2007-04-09 13:04:50 +00:00
Denis Vlasenko
240a1cfbbe add some missed statics on constant objects.
fix few #ifndef ENABLE_xxx

# size busybox_old busybox_unstripped
   text    data     bss     dec     hex filename
 677152    2920   18208  698280   aa7a8 busybox_old
 676420    2920   18208  697548   aa4cc busybox_unstripped
2007-04-08 16:07:02 +00:00
Denis Vlasenko
8d9f495d68 getopt32: fix llist_t options ordering. llist_rev is not unused.
function                                             old     new   delta
tar_main                                             705     695     -10
sort_main                                            928     918     -10
decode_format_string                                 886     876     -10
run_parts_main                                       197     185     -12
ps_main                                              513     500     -13
wget_main                                           2764    2750     -14
awk_main                                            1014    1000     -14
od_main                                             2886    2866     -20
llist_rev                                             25       -     -25
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/8 up/down: 0/-128)           Total: -128 bytes
2007-04-08 15:08:42 +00:00
Denis Vlasenko
bbd695d801 find: fix handling of -prune
recursive_actions: uppercase flag constants
2007-04-08 10:52:28 +00:00
Denis Vlasenko
bb5b01c7c7 comm: eliminate statics 2007-04-07 00:45:27 +00:00
Denis Vlasenko
df5bbb938a diff: fix segfault on empty dirs (Peter Korsgaard <peter.korsgaard@barco.com>) 2007-04-05 21:29:42 +00:00
Bernhard Reutner-Fischer
bdd253e450 - fix segfault in reset_ino_dev_hashtable() when *hashtable was null.
Seen in the testsuite for du -l .../testsuite on exit with CLEAN_UP enabled.
2007-04-05 09:21:24 +00:00
Bernhard Reutner-Fischer
febe3c4211 - sed -e "s/char[[:space:]]*\*[[:space:]]*argv\[\]/char **argv/g" 2007-04-04 20:52:03 +00:00
Bernhard Reutner-Fischer
d9c2d5fe4f - minor shrinkage
text    data     bss     dec     hex filename
   1431       0       4    1435     59b tail.o.orig
   1396       0       0    1396     574 tail.o
2007-04-04 20:29:15 +00:00
Bernhard Reutner-Fischer
2a47dea263 - remove bss users. Shrinkage while at it. See XXX for further, pre-existing bugs
text    data     bss     dec     hex filename
   1969       0      32    2001     7d1 dd.o.oorig
   1941       0       0    1941     795 dd.o
2007-04-04 14:01:23 +00:00
Bernhard Reutner-Fischer
3a60244ae9 - remove some bss users.
text    data     bss     dec     hex filename
   6220       8      14    6242    1862 stty.o.oorig
   6219       8       0    6227    1853 stty.o
2007-04-04 13:59:49 +00:00
Bernhard Reutner-Fischer
0e6ab01c5a - remove superfluous bss user (flags) and manually unswitch some areas:
text    data     bss     dec     hex filename
   4517       0      34    4551    11c7 stat.o.oorig
   4300       0      30    4330    10ea stat.o
2007-04-04 13:58:33 +00:00
Bernhard Reutner-Fischer
cea0a8bccb - use bb_error_msg 2007-04-02 17:01:22 +00:00
Bernhard Reutner-Fischer
8025afad8a - use xregcomp. Untested. vda, isn't there a regfree missing here?
text    data     bss     dec     hex filename
   2522       0       0    2522     9da expr.o.r18305
   2478       0       0    2478     9ae expr.o
2007-04-02 16:54:41 +00:00
Bernhard Reutner-Fischer
3c5929a53b - remove some unneeded forward declarations. No obj-code changes. 2007-04-02 16:41:24 +00:00
Bernhard Reutner-Fischer
adb01b1583 - remove args from bss, minor misc shrinkage while at it.
text    data     bss     dec     hex filename
   2577       0       4    2581     a15 expr.o
   2522       0       0    2522     9da expr.o
2007-04-02 16:38:13 +00:00
Denis Vlasenko
729bd9e0b0 test: comment out unused code
udpsvd: fake it compile
tcpsvd: more optimal memorizing of IP's for -C
2007-04-02 12:37:28 +00:00
Denis Vlasenko
4caa09a782 uniq: getopt32-ization. -38 bytes. 2007-03-31 10:19:11 +00:00
Bernhard Reutner-Fischer
7b881c7168 - fix compilation if FEATURE_TR_CLASSES is off. Sorry for that.. 2007-03-30 18:26:46 +00:00
Bernhard Reutner-Fischer
cc890264d9 - debloat test. untested.
text    data     bss     dec     hex filename
   3154       0     172    3326     cfe test.o.oorig
   2683       0     172    2855     b27 test.o

This applet should be rewritten not to use such odd lexer semantics.
It duplicates code from all over the place (see XXX).
brrr
2007-03-30 18:23:36 +00:00
Bernhard Reutner-Fischer
eceecea568 - fix bug where we did not reject invalid classes like '[[:alpha'
- debloat while at it:
   text    data     bss     dec     hex filename
   1554       0      19    1573     625 tr.o.oorig
   1357       0      16    1373     55d tr.o
2007-03-30 14:43:27 +00:00
Bernhard Reutner-Fischer
3e816c1252 - fold recurse, depthFirst and dereference params into one param flags.
Minor size improvement (-16b for size, -24b according to bloat-o-meter).
2007-03-29 10:30:50 +00:00
Bernhard Reutner-Fischer
0a537a0c57 - move additional fancy options not mandated by SUSv3 into a FANCY option 2007-03-28 16:48:40 +00:00
Denis Vlasenko
3983bd5593 diff: fix SEGV (NULL deref) in diff -N 2007-03-26 22:58:21 +00:00
Denis Vlasenko
91dd275f05 split: let me join bikeshed painting frenzy :)
this one should be able to handle huge files.
   text    data     bss     dec     hex filename
    664       4       0     668     29c busybox.t0/coreutils/split.o
    628       0       0     628     274 busybox.t1/coreutils/split.o
split_main                                           488     525     +37
suffix_len                                             4       -      -4
next_file                                             77       -     -77
(add/remove: 0/2 grow/shrink: 1/0 up/down: 37/-81)            Total: -44 bytes
2007-03-26 20:15:40 +00:00
Bernhard Reutner-Fischer
576de34d1c - check the suffix proper plus misc touch up 2007-03-26 18:19:29 +00:00
Bernhard Reutner-Fischer
b813eaff23 - implement suffices as required by SUSv3
- fix glitch in next_file (suffices were exhaused too early).
2007-03-26 14:28:12 +00:00
Bernhard Reutner-Fischer
cd43dfdeec - shrink a tiny bit (-8b) 2007-03-26 10:46:31 +00:00
Bernhard Reutner-Fischer
10f8f5f443 - rough prototype for split(1). TODO: Still needs some love since it's way too big..
text	   data	    bss	    dec	    hex	filename
    602	      4	      0	    606	    25e	coreutils/split.o
2007-03-25 21:50:18 +00:00
Denis Vlasenko
9a1fa8cf07 cmp: support 3rd and 4th arguments if DESKTOP=y (needed for gcc build) 2007-03-21 22:30:14 +00:00
Denis Vlasenko
c86e052b81 fix accumulated whitespace and indentation damage 2007-03-20 11:30:28 +00:00
Denis Vlasenko
97fd6d81b4 ls: fix segfault-if-standalone-shell, add big fat comment. 2007-03-19 20:59:20 +00:00
Denis Vlasenko
16c7fb7fc5 chown, env: stop using statics 2007-03-14 22:08:04 +00:00
Denis Vlasenko
e1e93c1e1c missed hunk of "stop using big static buffer for inode hash" 2007-03-14 22:06:57 +00:00
Denis Vlasenko
39c651e909 introduce and use setfscreatecon_or_die
(patch by Yuichi Nakamura <ynakam@hitachisoft.jp>)
runcon: *yet another* fix for vda's brainfart :(
2007-03-12 18:22:55 +00:00
Denis Vlasenko
1203c9bf2f next portion of selinux updates: chcon, runcon. From
Yuichi Nakamura <himainu-ynakam@miomio.jp>  
KaiGai Kohei <busybox@kaigai.gr.jp>
2007-03-11 22:16:02 +00:00
Denis Vlasenko
a4688bf55d fix buglets found by randomconfig run 2007-03-11 10:56:37 +00:00
Denis Vlasenko
49622d7846 selinux support by Yuichi Nakamura <ynakam@hitachisoft.jp> (HitachiSoft) 2007-03-10 16:58:49 +00:00
Denis Vlasenko
339f5eb2e0 printf: allow hex/oct numbers; move functions around
so that we have no forward declarations
2007-03-09 16:43:01 +00:00
Denis Vlasenko
02f0c4c2bf diff: failed to confirm "static bug" in gcc - reinstating statics.
microscopic code improvements.
2007-03-09 10:08:53 +00:00
Denis Vlasenko
8a91081d9d chown: fix comment, fix verbose message 2007-03-08 16:14:46 +00:00
Denis Vlasenko
cd27c42552 chown: support -H -L -P if ENABLE_DESKTOP
chmod: cosmetic fixes
expr: smallish help for dumb compilers
2007-03-08 13:37:43 +00:00
Denis Vlasenko
0085f231b2 diff: make -U0 work 2007-03-07 22:45:42 +00:00
Denis Vlasenko
8e858e2700 clean up accumulated whitespace damage 2007-03-07 09:35:43 +00:00
Denis Vlasenko
41cca2b4f5 who: stop using static buffer, small size optimizations 2007-03-07 00:07:42 +00:00
Denis Vlasenko
2110aa9ece ls: w/o -l follow symlinks to dirs for commandline args 2007-02-28 23:14:06 +00:00
Denis Vlasenko
cce38586ae start_stop_daemon: add -chuid support 2007-02-26 22:47:42 +00:00
Denis Vlasenko
54cf511ce1 sort: fix multiple -k (was ignoring all except last) 2007-02-17 18:11:45 +00:00
Denis Vlasenko
6089c2c31e diff: fix access past end of array 2007-02-11 19:07:03 +00:00
Denis Vlasenko
6ca0444420 syslogd: fix "readpath bug" by using readlink instead
libbb: rename xgetcwd and xreadlink
2007-02-11 16:19:28 +00:00
Denis Vlasenko
1d76f439da EXEC_PREFER_APPLETS support by Gabriel L. Somlo <somlo@cmu.edu> 2007-02-06 01:20:12 +00:00
Bernhard Reutner-Fischer
cbd6e65744 - fix buglet introduced in r17351 in find_param(). Closes #1193 2007-02-04 11:13:57 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Bernhard Reutner-Fischer
6a1829d90c - include busybox.h before looking at an eventual #if ENABLE_DESKTOP 2007-02-03 12:52:25 +00:00
Denis Vlasenko
a41fdf331a preparatory patch for -Wwrite-strings #1 2007-01-29 22:51:00 +00:00
Denis Vlasenko
e06bed30cf use bb_sanitize_stdio() where appropriate 2007-01-27 22:21:12 +00:00
Bernhard Reutner-Fischer
cd75a96f0f - sum -r TODO should not print the filename as oposed to -s
Unfortunately, without rewriting sum, this bugfix adds 19 (!) bytes.
2007-01-27 22:11:28 +00:00
Denis Vlasenko
fc7f92253a find: fix -mtime, -mmin, -perm (+ add symbolic perm handling)
chmod: better name for a variable
2007-01-26 23:00:05 +00:00
Bernhard Reutner-Fischer
84d2d493b4 - remove nested function. Saves ~30 bytes. 2007-01-24 21:38:10 +00:00
Bernhard Reutner-Fischer
d19f4aaa21 - small size tweak 2007-01-20 21:32:38 +00:00
Bernhard Reutner-Fischer
1118a1de46 - make pre SUSv3 option handling dependant on INCLUDE_SUSv2 2007-01-20 21:32:20 +00:00
Bernhard Reutner-Fischer
8b1ae45037 - small size tweak 2007-01-20 21:31:21 +00:00
Bernhard Reutner-Fischer
b31c252860 - reuse retval for the option handling.
- TODO add tee, readahead and splice support to uClibc and use it in busybox!
2007-01-20 21:30:49 +00:00
Bernhard Reutner-Fischer
088a212bf5 - small size tweaks 2007-01-20 21:29:50 +00:00
Bernhard Reutner-Fischer
ca5b35299e - make read_stduu() and read_base64() void, small size tweaks 2007-01-20 21:29:32 +00:00
Bernhard Reutner-Fischer
d58c19479d - small size tweak 2007-01-20 21:28:36 +00:00
Denis Vlasenko
e055443412 ls: stop doing time() for each file in "ls -l"
ls: use fully-buffered stdout (can it be problematic
on VERY slow/hanging NFS mounts?)
2007-01-19 22:03:06 +00:00
Denis Vlasenko
2405ad659e ls: use get_cached_username/groupname 2007-01-19 21:24:17 +00:00
Bernhard Reutner-Fischer
1a250d9f32 - reinstate paranoia check in wrapf(). 2007-01-18 08:41:22 +00:00
Denis Vlasenko
41aaefce71 stop using global variable needlessly 2007-01-18 00:53:35 +00:00
Bernhard Reutner-Fischer
79cc55975f - remove superfluous define that expanded to "!strcmp"
- remove some dead code
2007-01-17 19:46:46 +00:00
Bernhard Reutner-Fischer
8eb0549e5d - reuse return code of vsnprintf to avoid pulling in strlen 2007-01-17 19:46:33 +00:00
Bernhard Reutner-Fischer
94feb1c807 - merge display_changed() and display_all()
This one is a bit risky but did work for me in cursory testing..
2007-01-17 19:46:12 +00:00
Bernhard Reutner-Fischer
d4a745c3d4 - peruse get_terminal_width_height and remove legacy code for ancient
slowaris versions.
2007-01-17 19:45:36 +00:00
Bernhard Reutner-Fischer
a6e31ad834 - rewrite find_param to use index_in_str_array 2007-01-17 19:45:14 +00:00
Bernhard Reutner-Fischer
4950f010f3 - manually inline tty_value_to_baud and remove string_to_baud_or_die
(cleanup)
2007-01-17 19:44:59 +00:00
Bernhard Reutner-Fischer
21fc740023 - constify some read-only members and remove superfluous casts
(cleanup)
2007-01-17 19:44:24 +00:00
Bernhard Reutner-Fischer
4fa566d4ad - reuse option_mask32 for state-handling in main
- improve check for errors from fcntl
2007-01-17 19:42:30 +00:00
Denis Vlasenko
150f402b36 whitespace fixes (leading spaces to tab) 2007-01-13 21:06:21 +00:00
Denis Vlasenko
3a34d0c08a random small size optimizations 2007-01-12 22:10:34 +00:00
Denis Vlasenko
21b080daa8 stty: fix bug reported by Paul Albrecht <albrecht@rdi1.com> -
stty -echo didn't work. Introduced by me :(
2007-01-12 21:03:07 +00:00
Denis Vlasenko
f8abc100cc stty: rearrange functions, avoiding the need in forward declarations.
No other code chages.
2007-01-12 21:02:04 +00:00
Denis Vlasenko
f7996f3b70 Trailing whitespace removal over entire tree 2007-01-11 17:20:00 +00:00
Bernhard Reutner-Fischer
7ae93f0fe7 - FIXME: someone broke diff -r
- minor shrinkage i had lying around
   text	   data	    bss	    dec	    hex	filename
   7002	      8	     88	   7098	   1bba	diff.o.orig
   6936	      8	     81	   7025	   1b71	diff.o
2007-01-07 15:56:09 +00:00
Denis Vlasenko
b05955e0a5 work around gcc's false warning 2007-01-07 00:24:49 +00:00
Denis Vlasenko
8336f080cb diff: small optimizations; do not try to diff non-seekable stream
(currently we don't support that)
sort: fixes. testsuites fixed:
sort with non-default leading delim 1
sort with non-default leading delim 2
sort key doesn't strip leading blanks, disables fallback global sort
2007-01-07 00:21:41 +00:00
Bernhard Reutner-Fischer
ea9e35f5dd - minor shrinkage: -25 bytes or so. 2007-01-06 21:47:09 +00:00
Denis Vlasenko
a9b60e93ee new libbb func: xmalloc_realpath (+ use it where makes sense)
syslogd, logread: add debugging code (disabled)
syslogs: drastically smaller bss; fix "-C n" behaviour
2007-01-04 17:59:59 +00:00
Denis Vlasenko
6eebed561a chown: fix handling of "user.group" notation 2007-01-03 20:07:06 +00:00
Denis Vlasenko
ace35eeb88 Remove networking/libiproute/linux/pkt_sched.h
(and networking/libiproute/linux/ since it become empty).
Style fixes.
2007-01-02 16:32:16 +00:00
Mike Frysinger
a71199e0f0 str2u() is only used when FEATURE_SORT_BIG is enabled 2007-01-02 05:43:30 +00:00
Denis Vlasenko
6dc6ebbf44 awk: undo locale setting for numbers - or else parsing
can act quite mysteriously
date: add if(ENABLE_LOCALE_SUPPORT)
2007-01-01 23:53:12 +00:00
Denis Vlasenko
b2abef3e54 stty: fix width of a field for ppc32
sort: fix -u to match coreutils 6.3
msh: compile fix (my fault)
2007-01-01 18:18:04 +00:00
Denis Vlasenko
98ee06d3d4 stop using __u32 etc. uint32_t is there for a reason 2006-12-31 18:57:37 +00:00
Mike Frysinger
5dd76862ef Yann E. MORIN. writes: i pity the fool who doesnt use the z length modifier with size_t types 2006-12-31 11:34:17 +00:00
Denis Vlasenko
3bba545a54 done a dozen of randconfig test. guess what? ALL failed...
these are resulting fixes
2006-12-30 17:57:03 +00:00
Denis Vlasenko
7fa0fcafca fix build without shadow support 2006-12-28 21:33:30 +00:00
Denis Vlasenko
9a44c4f91c bb_xget[pw/gr]nam were horribly misnamed - fixed.
uidgid_get -> get_uidgid, add additional param
(numeric_ok). Make chown use it.
chown: fix "chown user: ...."
install: fix incorrect use of bb_xget[pw/gr]nam
2006-12-28 05:44:47 +00:00
Denis Vlasenko
bf0a201008 style fixes
last xcalloc replaced by xzalloc
2006-12-26 10:42:51 +00:00
Denis Vlasenko
9ac9e55e3c sum: 40% size reduction (-300 bytes)
find: one_char -> LONE_CHAR
2006-12-23 15:58:11 +00:00
Denis Vlasenko
e31f721e14 tail: -50 text bytes 2006-12-22 16:06:16 +00:00
Denis Vlasenko
0849207ce0 convert "negaite" config option into reversed (INCLUDE_SUSv2) 2006-12-22 13:56:36 +00:00
Denis Vlasenko
afc9ff99fd removal of commented-out cruft 2006-12-22 00:45:27 +00:00
Denis Vlasenko
714701c890 tar et al: die if bb_copyfd_size copies less than asked for.
(we have bb_copyfd_exact_size now for that kind of usage)
2006-12-22 00:21:07 +00:00
Denis Vlasenko
e865e81d34 less: stop dying on bad regexps, quietly pipe data w/o
user interaction if stdout is not a tty.
size optimizations
2006-12-21 13:24:58 +00:00
Denis Vlasenko
bf66fbc8e2 introduce LONE_CHAR (optimized strcmp with one-char string) 2006-12-21 13:23:14 +00:00
Denis Vlasenko
6910741067 tail: fix tail +N 2006-12-21 00:43:06 +00:00
Denis Vlasenko
b95636c52f remove casts from xmalloc() 2006-12-19 23:36:04 +00:00
Denis Vlasenko
83e5d6f772 A bunch of defined(__GLIBC__) added. static-linking warning expanded 2006-12-18 21:49:06 +00:00
Denis Vlasenko
f42ff90453 du: dietlibc compat fix, style fixes. Thanks to sampo@symlabs.com. 2006-12-18 21:22:16 +00:00
Denis Vlasenko
0f5905e617 od: remove bug-for-bug compat (because the bug was fixed in coreuitls) 2006-12-17 19:21:13 +00:00
Denis Vlasenko
9f739445cd inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid] 2006-12-16 23:49:13 +00:00
Denis Vlasenko
6a1d661036 diff: fix -q exit code
last_char_is: sacrifice 9 bytes but avoid double-scan
2006-12-16 22:18:44 +00:00
Bernhard Reutner-Fischer
56b956952e - minor shrinkage 2006-12-14 11:27:58 +00:00
Bernhard Reutner-Fischer
5b6f776fe9 - remove warning about unused depth parameter in add_to_dirlist()
- make one variable static and add comment about why the other variables there are not static.
2006-12-13 16:50:15 +00:00
Denis Vlasenko
35a4bbe74f date: -R shouldn't use locale 2006-12-13 00:35:21 +00:00
Bernhard Reutner-Fischer
91d4a2dac3 - commentary typo 2006-12-02 20:47:36 +00:00
Denis Vlasenko
2425bdce34 od: fix buglet in --traditional, microoptimization,
document coreutils bug
bloat-o-meter: account for objects in rodata too
2006-11-29 14:32:01 +00:00
Denis Vlasenko
c61852a02b fix support for globally disabling --long-options.
(disabling them saves ~4K on fully configured bbox)
2006-11-29 11:09:43 +00:00
Denis Vlasenko
601ae1378b od: sometime ago I landed BIG od implementation
from coreutils. My fault. This commit contains
cleanups and size reductions.
2006-11-28 23:37:46 +00:00
Denis Vlasenko
d9e15f2068 style cleanup: return(a) -> return a, part 2 2006-11-27 16:49:55 +00:00
Denis Vlasenko
079f8afa0a style cleanup: return(a) -> return a, part 1 2006-11-27 16:49:31 +00:00
Denis Vlasenko
459903bd4e Provide our own isdigit macro. saves more than 400 bytes. 2006-11-27 14:44:18 +00:00
Denis Vlasenko
d686a045c8 safe_strtoXX interface proved to be a bit unconvenient.
Remove it, introduce saner bb_strtoXX.
Saved ~350 bytes.
2006-11-27 14:43:21 +00:00
Denis Vlasenko
664733f1a3 sort: two small optimizations 2006-11-26 15:48:54 +00:00
Denis Vlasenko
0d42ddff70 sort: reformat entire file wrt style.
fix single obvious bug: right hand was 0 here:
 flags & (FLAG_b&FLAG_d&FLAG_f&FLAG_i&FLAG_bb)
fixed to use |
2006-11-26 15:48:03 +00:00
Denis Vlasenko
cf749bc10c small fixes:
fix xstrdup to not grossly overallocate memory
use xopen instean of xopen3 in several places
etc.
2006-11-26 15:45:17 +00:00
Denis Vlasenko
2d27e4ccbb tee: fix bug: argv[-1] is a no-no!
bb_full_fd_action: optimize
die_if_ferror: "<applet>: filename" isn't a good err msg, add "..I/O error"
2006-11-25 23:50:28 +00:00
Denis Vlasenko
5dd27b1ee0 dd: support >2gb values for seek, skip, count 2006-11-25 14:46:21 +00:00
Denis Vlasenko
cf30cc82a3 header_verbose_list: stop truncating file size in listing 2006-11-24 14:53:18 +00:00
Denis Vlasenko
14621929a1 md5sum: make -c grok formats like "68b329da9893e34099c7d8ad5cb9c940 *foo".
Also eradicate 95 bytes of bloat.
2006-11-23 15:59:12 +00:00
Denis Vlasenko
5d148e2646 httpd: fix cgi-bin/index.cgi support, add example of it,
stat: fix end-of-line if format is specified (wasn't printing it),
      fix %z (time) format to match coreutils 6.3
2006-11-21 00:12:09 +00:00
Denis Vlasenko
fcdb00f735 httpd: LC_TIME locale _must_ be POSIX to httpd! We speak over the net! 2006-11-21 00:09:37 +00:00
Denis Vlasenko
22dcd04f8f mkdir: style fix 2006-11-19 13:53:50 +00:00
Denis Vlasenko
89f0b3486d rodata cleanup. "unable to" == "cannot". -300 bytes 2006-11-18 22:04:09 +00:00
Bernhard Reutner-Fischer
e766715032 - end may be used uninitialized.
- TODO: should eventually use skip_whitespace there
2006-11-17 11:28:00 +00:00
Denis Vlasenko
9225854144 mostly style fixes 2006-11-01 10:25:35 +00:00
Denis Vlasenko
3b8ff68ec8 dd: fix bugs: always assumed conv=sync, died on write errors
w/o perror and statictics. Several small improvements
2006-10-31 15:55:56 +00:00
Denis Vlasenko
656f746e74 ls: silly comment fixes 2006-10-28 13:02:55 +00:00
Denis Vlasenko
8c0c119130 chmod: typo in comments 2006-10-28 12:42:40 +00:00
Denis Vlasenko
94cf69fe3e ls: cleanup part 2. ifdef forest is much less scary now :) 2006-10-28 12:37:51 +00:00
Denis Vlasenko
5c7596058d ls: cleanup part 1 2006-10-28 12:37:16 +00:00
Denis Vlasenko
8c35d65c43 recursive_action: add depth param
chmod: match coreutils versus following links
2006-10-27 23:42:25 +00:00
Denis Vlasenko
e80e2a3660 chgrp: just call chown! :) 2006-10-27 23:28:38 +00:00
Denis Vlasenko
51b4c92f80 chown: add -vcf support if CONFIG_DESKTOP
chmod: stop following symlinks
2006-10-27 16:07:20 +00:00
Denis Vlasenko
fefb279ace chmod: support -vcf if CONFIG_DESKTOP 2006-10-27 15:13:54 +00:00
Denis Vlasenko
dca0b707c0 reshuffle libbb.h contents so that order of decls makes sense
Found bad typo in largefile support :)
2006-10-27 09:05:02 +00:00
Denis Vlasenko
621204bbf6 get_terminal_width_height: do not pass insanely large values 2006-10-27 09:03:24 +00:00
Denis Vlasenko
d3d004dd35 last nail into error_msg() (de)capitalization 2006-10-27 09:02:31 +00:00
Denis Vlasenko
2fe7b73d99 ...and yet another small fix. Ouch... 2006-10-26 23:39:04 +00:00
Denis Vlasenko
ddec5af6b0 rename functions to more understandable names 2006-10-26 23:25:17 +00:00
Denis Vlasenko
f0ed376eda remove bb_printf and the like 2006-10-26 23:21:47 +00:00
Denis Vlasenko
c6f188def8 silly size savings and capitalization fixes 2006-10-26 00:37:00 +00:00
Denis Vlasenko
703aa13ff5 watch: fix warning
getty: fix breakage; fix excessive stack usage
2006-10-23 22:43:02 +00:00
Denis Vlasenko
f24e1f40e0 cp: add support for -s, -l. Fix free(nonmalloc) bug.
Add doc on POSIX's rules on -i and -f (insane!).
ln: make "ln dangling_symlink new_link" work.
2006-10-21 23:40:20 +00:00
Denis Vlasenko
8d73c35916 watch: execute command thru shell, not fork/exec. Other fixes 2006-10-20 23:48:30 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
ea62077b85 add open_read_close() and similar stuff 2006-10-14 02:23:43 +00:00
Denis Vlasenko
2d5ca60bfb bb_get_[chomped]line_from_file wasn't descriptive enough.
Renaming...
2006-10-12 22:43:20 +00:00
Denis Vlasenko
372686bde7 cut, mount: small improvements 2006-10-12 22:42:33 +00:00
Denis Vlasenko
1114de7219 od: provide full-blown od from coreutils if CONFIG_DESKTOP 2006-10-10 23:26:05 +00:00
Denis Vlasenko
ca3c981c07 start_stop_daemon: add -N <nice> compat
[re]nice: add support for -nNNN w/o spaces, -NNN (nice only),
          simplified code
2006-10-08 23:36:17 +00:00
Denis Vlasenko
7039a66b58 correct largefile support, add comments about it. 2006-10-08 17:54:47 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00