Commit Graph

149 Commits

Author SHA1 Message Date
"Vladimir N. Oleynik"
10a1fe6169 remove infinity loop ./busybox --help busybox 2005-09-05 11:25:27 +00:00
Rob Landley
8a7a678b03 Fixes so "make allnoconfig" works again.
The configure system's save function edited out sub-menus that wouldn't be
displayed in the current configuration, meaning config.h wouldn't have #udef
entries for those symbols, meaning bb_config.h would have the relevant
ENABLE_ missing instead of defined to 0.  This broke the build.

So I fixed it, and then reorganized the applets.c and busybox.c to take
away the warnings this revealed (code that would be optimized out was making
calls to functions that hadn't been prototyped.  So I added an #else case
to those #ifdefs to #define the relevant functions to empty macros to
placate the warnings.

I also reorganized the applets.c code to make adding such an #else case less
of a pain (and make the need for prototyping go away by moving the functions
up before they were used, and generally wind up with fewer #ifdefs in
the code by putting all the logic in one place).  This resulted in a huge
seeming patch, when most if it just moves code from one place to another
without touching it...

Upside: make allyesconfig and make allnoconfig should both work now.
2005-09-05 04:13:33 +00:00
Rob Landley
b766c39456 General cleanup of command line parsing to allow "busybox" to work as a prefix.
(I.E. any argv[0] that starts with "busybox" winds up in busybox_main().)

Added testing/busybox.tests which tests the following permutations:

./busybox
./busybox-suffix
./busybox cat
./busybox-suffix cat
./busybox --help
./busybox-suffix --help
./busybox --help cat
./busybox-suffix --help cat
./busybox --help unknown
./busybox-suffix --help unknown
./unknown

Also repair the test suite so ./runtest calls the ".tests" scripts properly.

Note: you can now go "busybox busybox busbox ls -l" and it'll take it.  The
new code is pretty generic.  I can block that if anybody can come up with a
good reason to...
2005-09-04 11:10:37 +00:00
Mike Frysinger
2c12d435e5 output busybox help to stdout, not stderr 2005-04-22 02:19:01 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Tim Riker
b1ffba0401 wrap bb help output if CONFIG_FEATURE_AUTOWIDTH 2003-11-07 19:37:20 +00:00
Glenn L McGrath
fd7bc13557 Woops, the previous patch reversal wasnt complete, breaking everything. 2003-10-04 00:05:47 +00:00
Glenn L McGrath
f86bd9f2cd Reverse my previous changes and make a note about why its dont this way 2003-10-03 13:21:10 +00:00
Glenn L McGrath
4a77c781ef argc has already been decremented 2003-10-03 07:51:30 +00:00
Glenn L McGrath
cb920d9778 Patch from Rob Landley, Simplify organisation of arguments. 2003-10-03 03:25:30 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Eric Andersen
fcffa2cc1a Apply lash_patch35 from vodz, which brings several nice size_optimizations. 2002-04-06 05:17:57 +00:00
Eric Andersen
fb74a45088 Vodz' last_patch31
Very minimal last corrections:

    1) busybox.c: fix warining
    2) docs/: add applets for list from pwd_grp
    3) usage.h: add -n option for route
    4) run_parts.c: many todo fix for busybox style
    5) addgroup.c: add #ifdef CONFIG_FEATURE_SHADOWPASSWDS, reduce one
    perror_msg
    6) adduser.c: fix bug "variable i not initialize" and
       add #ifdef CONFIG_FEATURE_SHADOWPASSWDS
2001-12-18 14:06:03 +00:00
Eric Andersen
bdfd0d78bc Major rework of the directory structure and the entire build system.
-Erik
2001-10-24 05:00:29 +00:00
Matt Kraai
449377aa6a Fix invocation of `-/bin/sh' (bug #1209). 2001-08-27 15:02:32 +00:00
Eric Andersen
fa2661f2e5 Per a suggestion from Tom Oehser, fix up the leading-hyphen hack to
make it general.  Now all leading single hyphens are ignored for
purposed of applet name matching, while argv[0] is still passed
unaltered to applets, so leading-hyphen sensitive applets (such as sh)
can react accordingly.
 -Erik
2001-06-21 04:56:24 +00:00
Eric Andersen
77d9268892 Patch from larry to fix some grammar errors. 2001-05-23 20:32:09 +00:00
Eric Andersen
4819c3d477 Make the locale stuff only do the getpid==1 check if BB_INIT is defined 2001-05-13 00:33:16 +00:00
Eric Andersen
28355a36da Per some comments from Lars Kellogg-Stedman <lars@larsshack.org>,
make xreadlink() return NULL on failure, and make sure everyone
uses the interface correctly.
 -Erik
2001-05-07 17:48:28 +00:00
Mark Whitley
8a633268ef Made new xreadlink function for libbb and changed applets to use it instead of
readlink(2).
2001-04-30 18:17:00 +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
e5dfced23a Apply Vladimir's latest cleanup patch.
-Erik
2001-04-09 22:48:12 +00:00
Eric Andersen
0f0c0b41ce Make 'busybox --help' work as expected, closing bug #1139
-Erik
2001-04-03 17:05:01 +00:00
Eric Andersen
ba372620c2 Force applet_name to be "sh" when command prefaced by "-" 2001-03-20 17:39:53 +00:00
Eric Andersen
2ccfef2004 Patch from Vladimir to move struct applet from busybox.c to applets.c,
which looks like the right place for such things to live.
2001-03-19 19:30:24 +00:00
Mark Whitley
016771834a Changed exit code from -1 to 0 when busybox is invoked with no args.
(Closes bug #1114.)
2001-03-02 17:47:17 +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
Eric Andersen
67991cf824 This patch, put together by Manuel Novoa III, is a merge of work
done by Evin Robertson (bug#1105) and work from Manuel to make
usage messages occupy less space and simplify how usage messages
are displayed.
2001-02-14 21:23:06 +00:00
Matt Kraai
f2cc2762bb Create find_applet_by_name function. Save 32 bytes. 2001-02-01 19:21:20 +00:00
Matt Kraai
dd19c69904 Removed trailing \n from error_msg{,_and_die} messages. 2001-01-31 19:00:21 +00:00
Eric Andersen
90ca2848fd Fix some formatting 2001-01-27 08:32:57 +00:00
Eric Andersen
ed3ef50c23 Fix header file usage -- there were many unnecessary header files included in
busybox.h which slowed compiles.  I left only what was needed and then fixed up
all the apps to include their own header files.  I also fixed naming for pwd.h
and grp.h functions.  Tested to compile and run with libc5, glibc, and uClibc.
 -Erik
2001-01-27 08:24:39 +00:00
Eric Andersen
f5d5e77321 more bugs fixed -- found doing regression testing
-Erik
2001-01-24 23:34:48 +00:00
Matt Kraai
1fa1adea2a Change calls to error_msg.* and strerror to use perror_msg.*. 2000-12-18 03:57:16 +00:00
Matt Kraai
8abc78aa84 Rewrite argv munger. 2000-12-15 00:35:22 +00:00
Eric Andersen
8c28fd7849 Forget to set final argv entry to NULL, breaking sh.c amoung
other things...
2000-12-09 00:19:30 +00:00
Eric Andersen
5e09b6e3a8 when invoked as 'busybox foo args' remove the "busybox"
so ps shows only what we want it to show...
2000-12-08 19:03:12 +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
8c725e624a Patch from Larry Doolittle (with minor touchups from me so everything compiles
and works) to use the applet definitions in applets.h to autogenerate the applet
function and usage prototypes.
2000-11-30 00:27:06 +00:00
Eric Andersen
e5aef92e22 Fix up builtin overrides, and hack in the binary search for finding
matching applets into the shell.
2000-11-17 18:25:26 +00:00
Matt Kraai
2dab174daa Restore --help handling I mistakenly removed. 2000-10-25 19:05:38 +00:00
Matt Kraai
a0428eee9e Avoid reinventing the wheel (and thus save some space). 2000-10-25 19:00:51 +00:00
Mark Whitley
130005cd89 Applied patch from Gaute B Strokkenes <gs234@cam.ac.uk> to use a binary search
to locate applets, rather than a linear search. Also, broke out the listing of
applets into it's own file: applets.h.
2000-10-25 00:28:27 +00:00
Mark Whitley
6050618096 Put getopt_usage where it belongs and added *_usage entries in busybox.[ch] 2000-10-19 22:28:06 +00:00
Mark Whitley
872138de50 Added cmp and readlink applets from Matt Kraai. 2000-10-09 18:56:47 +00:00
Eric Andersen
3570a34de4 Renamed "internal.h" to the more sensible "busybox.h".
-Erik
2000-09-25 21:45:58 +00:00
Eric Andersen
c5949f62e5 Fix from Matt Kraai for the to the "busybox --install prints out on STDERR
"File already exists" messages for all files (including the ones that DON'T
exist)" problem reported by "Bruno L. F. Cabral" <bruno@openline.com.br>.

Thanks Matt!
 -Erik
2000-09-25 20:35:54 +00:00
Eric Andersen
92a61c1206 Add in xargs 2000-09-22 20:01:23 +00:00
Eric Andersen
cff3fe3ae9 Added dos2unix, unix2dos, and unrpm.c thanks to robotti@metconnect.com.
-Erik
2000-09-20 19:22:26 +00:00
Eric Andersen
1b355ebba6 Added expr, from Edward Betts <edward@debian.org>, with some fixups
and docs added by me.
 -Erik
2000-09-05 17:37:48 +00:00