Denis Vlasenko
bd28f6bf7f
test: fix parser to prefer binop over unop, as coreutils does.
...
remove bogus workaround in main(). rename atrocious variables/functions.
much expand testsuite.
libbb: fix --help to not affect "test --help"
function old new delta
run_applet_no_and_exit 421 440 +19
nexpr 817 825 +8
static.no_op - 6 +6
test_main 397 257 -140
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 2/1 up/down: 104/-211) Total: -107 bytes
2008-07-19 08:15:13 +00:00
Denis Vlasenko
a60f84ebf0
*: rename ATTRIBUTE_XXX to just XXX.
2008-07-05 09:18:54 +00:00
Denis Vlasenko
77ad97f199
more -Wall warning fixes from Cristian Ionescu-Idbohrn.
...
This time it resulted in small code changes:
function old new delta
nexpr 820 828 +8
tail_main 1200 1202 +2
wrapf 166 167 +1
parse_mount_options 227 209 -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 11/-18) Total: -7 bytes
2008-05-13 02:27:31 +00:00
Denis Vlasenko
5d89fbaa2e
*: remove remaining instances of ".data" hack
2008-04-22 00:08:27 +00:00
Denis Vlasenko
574f2f4394
*: add optimization barrier to all "G trick" locations
2008-02-27 18:41:59 +00:00
Denis Vlasenko
1e2a7e4ed1
test: fix mishandling of 'test ! arg1 op arg2 more args'; add testsuite
2008-02-09 05:48:42 +00:00
Denis Vlasenko
6672c8e480
test: stop using lots of bss.
...
function old new delta
test_main 425 456 +31
t_lex 69 73 +4
syntax 100 104 +4
ptr_to_statics 8 12 +4
t_wp_op 4 - -4
t_wp 4 - -4
ngroups 4 - -4
group_array 4 - -4
binop 590 585 -5
oexpr 104 97 -7
aexpr 101 94 -7
nexpr 831 820 -11
leaving 156 - -156
------------------------------------------------------------------------------
(add/remove: 0/5 grow/shrink: 4/4 up/down: 43/-202) Total: -159 bytes
text data bss dec hex filename
775098 929 9084 785111 bfad7 busybox_old
775107 933 8908 784948 bfa34 busybox_unstripped
2007-11-30 07:29:05 +00:00
Bernhard Reutner-Fischer
a702457eac
- remove most of the forward declarations. No obj-code changes.
2007-11-16 12:20:30 +00:00
Denis Vlasenko
fc5d15912c
test: correct confusing placement of "const"
2007-09-21 17:58:43 +00:00
Denis Vlasenko
dc757aa16c
introduce and use bb_basename()
...
function old new delta
bb_basename - 26 +26
sv_main 1226 1225 -1
passwd_main 1985 1983 -2
showdirs 482 478 -4
sendCgi 1811 1807 -4
make_device 1354 1350 -4
handleIncoming 2443 2439 -4
func_name 82 78 -4
service_name 2292 2285 -7
main 909 901 -8
cmp_main 555 547 -8
test_main 434 422 -12
act 228 216 -12
find_pair 180 164 -16
rmmod_main 298 280 -18
find_pid_by_name 156 134 -22
modprobe_main 1606 1576 -30
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/16 up/down: 26/-156) Total: -130 bytes
text data bss dec hex filename
734933 3028 14400 752361 b7ae9 busybox_old
734801 3028 14400 752229 b7a65 busybox_unstripped
2007-06-30 08:04:05 +00:00
Denis Vlasenko
80b8b39899
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
2007-06-25 10:55:35 +00:00
Denis Vlasenko
88308fec80
test: suppress gcc warning
...
telnetd: do not use suferfluous static variable.
2007-06-25 10:35:11 +00:00
Denis Vlasenko
b304eadca8
test: shrink a bit
...
function old new delta
test_main 5 434 +429
bb_test 473 - -473
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 429/-473) Total: -44 bytes
text data bss dec hex filename
735073 3028 14408 752509 b7b7d busybox_old
735029 3028 14408 752465 b7b51 busybox_unstripped
2007-06-21 13:35:52 +00:00
Bernhard Reutner-Fischer
be99243945
- fix test -f ./exists
...
Note that test -f ./exists -a "-u" = "-u" doesn't work and did not work even before r18282, so this is a breakage not caused by me..
2007-06-15 10:36:49 +00:00
Bernhard Reutner-Fischer
fdcbc4e709
- fix testing primary expressions like '"-u" = "-u"'
2007-06-12 13:21:08 +00:00
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
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
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
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
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
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
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
Denis Vlasenko
06af216528
suppress warnings about easch <applet>_main() having
...
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
bf66fbc8e2
introduce LONE_CHAR (optimized strcmp with one-char string)
2006-12-21 13:23:14 +00:00
Denis Vlasenko
079f8afa0a
style cleanup: return(a) -> return a, part 1
2006-11-27 16:49:31 +00:00
Rob Landley
ecb29573e9
"Jordan Crouse" <jordan.crouse@amd.com> says:
...
The following patch makes coreutils/test.c act fail gracefully if getgroups()
returns a -1. This fixes a problem on the One Laptop Per Child ROM image
whereby we were getting odd Memory exhausted messages for '[' and 'test'.
Found by Mitch Bradley <wmb@firmworks.com>
(Tweaked by Rob: no need to initialize a static to NULL, or realloc something
that's only allocated when it's NULL.)
2006-08-22 23:40:28 +00:00
"Robert P. J. Day"
68229837ff
Remove all usage of the "register" storage class specifier.
2006-07-01 13:08:46 +00:00
Rob Landley
ea224be6aa
skip_whitespace() shouldn't claim its return value is const, it doesn't know
...
that and callers wind up typecasting it back.
2006-06-18 20:20:07 +00:00
Paul Fox
6ab037872f
made "test" an ash built-in.
...
moved the contents of libbb/bb_echo.c back into coreutils/echo.c,
which is a more reasonable place for them than libbb. this
forces anyone who wants echo and test to be builtin to ash to
also have them available as applets. their cost is very small,
and the number of people who wouldn't want them as applets is
also very small.
added warning about shell builtins vs. CONFIG_FEATURE_SH_STANDALONE_SHELL,
which conflicts with their use.
thanks to nathanael copa for debugging help.
some string size optimization in test.c may have been lost with
this commit, but this is a good new baseline.
2006-06-08 21:37:26 +00:00
Bernhard Reutner-Fischer
19008b8373
- reuse strings and messages. Saves about 600B
2006-06-07 20:17:41 +00:00
Rob Landley
dfba741457
Robert P. Day removed 8 gazillion occurrences of "extern" on function
...
definitions. (That should only be on prototypes.)
2006-03-06 20:47:33 +00:00
Tim Riker
c1ef7bdd8d
just whitespace
2006-01-25 00:08:53 +00:00
Mike Frysinger
4e5936ef95
In Bug 208, bernhardf writes:
...
On machines with only ANSI compliant compilers, not explitily delcaring
an empty parameter list 'void' causes failure.
2005-04-16 04:30:38 +00:00
Mike Frysinger
75ac42b1ae
add aliases == and [[ for = and [ to support more bash scripts
2005-04-14 02:49:22 +00:00
Glenn L McGrath
73db8be80a
Patch from Bastian Blank to add 64 bit support to the test command.
...
Example of broken usage: ./busybox test 2147483648 -gt 2147483648
2004-08-11 02:45:47 +00:00
Eric Andersen
c7bda1ce65
Remove trailing whitespace. Update copyright to include 2004.
2004-03-15 08:29:22 +00:00
Eric Andersen
cb81e6484d
Update a bunch of docs. Run a script to update my email addr.
2003-07-14 21:21:08 +00:00
Eric Andersen
8876fb2f59
last_patch89 from vodz:
...
Manuel,
I rewrite bb_getopt_ulflags() function for more universal usage.
My version support now:
- options with arguments (optional arg as GNU extension also)
- complementaly and/or incomplementaly and/or incongruously and/or list
options
- long_opt (all applets may have long option, add supporting is trivial)
This realisation full compatibile from your version.
Code size grow 480 bytes, but only coreutils/* over compensate this size
after using new function. Last patch reduced over 800 bytes and not full
applied to all. "mkdir" and "mv" applets have long_opt now for demonstrate
trivial addition support long_opt with usage new bb_getopt_ulflags().
Complementaly and/or incomplementaly and/or incongruously and/or list options
logic is not trivial, but new "cut" and "grep" applets using this logic
for examples with full demostrating. New "grep" applet reduced over 300
bytes.
Mark,
Also. I removed bug from "grep" applet.
$ echo a b | busybox grep -e a b
a b
a b
But right is printing one only.
--w
vodz
2003-06-20 09:01:58 +00:00
Manuel Novoa III
cad5364599
Major coreutils update.
2003-03-19 09:13:01 +00:00
Glenn L McGrath
acfc0d872e
Run through indent, fix comments
2002-08-23 06:05:11 +00:00
Eric Andersen
74400ccfd0
Scrub up some function prototypes.
...
-Erik
2001-10-18 04:11:39 +00:00
Eric Andersen
04095e58fb
Move messages.c to libbb. Make each string in messages.c be its own .o file.
...
This way, we can new get rid of all that tedious #define rubbish we used to
need to enable specific messages. This way is enormously simpler, and as a
bonus also ends up saving us 96 bytes.
-Erik
2001-04-25 05:39:18 +00:00
Eric Andersen
92d23245c9
Another cleanup patch from Jeff Garzik <jgarzik@mandrakesoft.com>
2001-03-19 23:49:41 +00:00
Eric Andersen
cbe31dace5
It turns out that DODMALLOC was broken when I reorganized busybox.h
...
header file usage before the 0.49 release. To fix it, I had to move
the '#include "busybox.h"' to the end of the list of #include files.
-Erik
2001-02-20 06:14:08 +00:00
Matt Kraai
dd19c69904
Removed trailing \n from error_msg{,_and_die} messages.
2001-01-31 19:00:21 +00:00
Matt Kraai
e6e818309e
Improvements from Vladimir N. Oleynik.
2000-12-30 07:46:23 +00:00
Mark Whitley
f57c944e09
Changed names of functions in utility.c and all affected files, to make
...
compliant with the style guide. Everybody rebuild your tags file!
2000-12-07 19:56:48 +00:00
Eric Andersen
3570a34de4
Renamed "internal.h" to the more sensible "busybox.h".
...
-Erik
2000-09-25 21:45:58 +00:00