Commit Graph

63 Commits

Author SHA1 Message Date
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
Denis Vlasenko
9b49a5ed85 add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-11 10:05:36 +00:00
Denis Vlasenko
0c97c9d437 'simple' error message functions by Loic Grenie <loic.grenie@gmail.com>.
263 bytes saved.
2007-10-01 11:58:38 +00:00
Denis Vlasenko
818322b9b1 *: kill bb_get_last_path_component, replace with two functions
(one which strips trailing slash and one which does not)
wget: straighten out as a result of above change
   text    data     bss     dec     hex filename
   5056       1       0    5057    13c1 busybox.t4/networking/wget.o
   5022       0       0    5022    139e busybox.t5/networking/wget.o
2007-09-24 18:27:04 +00:00
Denis Vlasenko
fe7cd642b0 don't pass argc in getopt32, it's superfluous
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes
   text    data     bss     dec     hex filename
 773469    1058   11092  785619   bfcd3 busybox_old
 772644    1058   11092  784794   bf99a busybox_unstripped
2007-08-18 15:32:12 +00:00
Denis Vlasenko
6a2f7f41cf whitespace fixes, no code changes 2007-08-16 10:35:17 +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
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
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
a41fdf331a preparatory patch for -Wwrite-strings #1 2007-01-29 22:51:00 +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
67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
"Robert P. J. Day"
801ab14013 Add one-line GPL boilerplate to numerous (but not all yet) source files. 2006-07-12 07:56:04 +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
Rob Landley
cdbae77823 printf() arguments shouldn't be passed straight from user supplied data.
(Security thingy.)
2005-12-12 06:49:33 +00:00
"Vladimir N. Oleynik"
39a841cecf change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers
reduce 100 bytes don't care in sum
2005-09-29 16:18:57 +00:00
Rob Landley
3071e2fda3 Patch from Matthew S. Wood:
> The following patch adds support for the -S and -b flags to `ln'.  These
> flags [especially -b] are used extensively in Debian pre and post
> installation scripts.

Comments from Vladimir Oleynik influenced the final patch, and I also ripped
out the in-file changelog since it belongs here.  At the time, it said:

/* Apr 15, 2004      Matthew S. Wood    (mwood@realmsys.com)
 *
 * Implement '-b' (backup) flag.
 * Implement '-S' (backup suffix) flag.
 *
 *
 * Mar 16, 2003      Manuel Novoa III   (mjn3@codepoet.org)
 *
 * Fixed bug involving -n option.  Essentially, -n was always in effect.
 */
2005-04-29 22:13:04 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Glenn L McGrath
95f75a3dcd Patch from Bastian Blank to fix debian bug #226722, test case:
mkdir foo
 touch foo/bar
 ln -s bar foo/baz
2004-01-08 10:51:09 +00:00
Glenn L McGrath
cfc0ad4260 Batch from Bastian Blank to fix debian bug #216435;
When linking a non existing file busybox ln will report the target
missind and not the source:
2003-12-31 23:10:44 +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
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Robert Griebl
d378c3149c Applied vodz' patches #49 and #50 (with a small correction in runshell.c)
#49: I found one memory overflow and memory leak in "ln" applet.
Last patch reduced also 54 bytes. ;)

#50: I found bug in loginutils/Makefile.in.
New patch have also new function to libbb and
aplied this to applets and other cosmetic changes.
2002-07-19 00:05:54 +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
bdfd0d78bc Major rework of the directory structure and the entire build system.
-Erik
2001-10-24 05:00:29 +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
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
d69d2da165 use perror_msg instead of perror to print the applet name.
-Erik
2001-02-15 20:12:05 +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
Eric Andersen
8ec10a9483 Fix up copyright msgs. Bump version to 0.49 in preparation for
a release.  Update the website with release details.
 -Erik
2001-01-27 09:33:39 +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
Mark Whitley
59ab025363 #define -> static const int. Also got rid of some big static buffers. 2001-01-23 22:30:04 +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
13241dfbdd Patch from Matt Kraai: "When it encounters a problem creating a link, ln
shouldn't give up entirely but instead continue processing the rest of its
arguments.  The attached patch does this."
2000-10-04 16:02:53 +00:00
Glenn L McGrath
aa3908d1b7 Rewrite to use getopt and return instead of exit, a seperate function (fs_link) does the actual work. 2000-10-04 09:34:35 +00:00
Eric Andersen
3570a34de4 Renamed "internal.h" to the more sensible "busybox.h".
-Erik
2000-09-25 21:45:58 +00:00
Matt Kraai
322ae93a5e Fix calls to {m,c,re}alloc so that they use x{m,c,re}alloc instead of
segfaulting or handling errors the same way themselves.
2000-09-13 02:46:14 +00:00
Matt Kraai
bf181b9338 Extract usage information into a separate file. 2000-07-16 20:57:15 +00:00
Matt Kraai
d537a95fdb Use errorMsg rather than fprintf. 2000-07-14 01:51:25 +00:00
Eric Andersen
0c838af50b Re-enable ln -n in the help.
-Erik
2000-07-11 17:38:27 +00:00
Eric Andersen
195fa15caf Another patch from Matt Kraai <kraai@alumni.carnegiemellon.edu>:
>
> The following patch allows ln -n to function like GNU.  It also fixes a
> typo with my previous patch to add support for ln FILE DIRECTORY.  And
> it removes some code that checks the maximum length of the filenames.  I
> can't figure out why that code is necessary.  Anyone know?
>
> Matt
2000-07-11 17:35:32 +00:00
Eric Andersen
9b2297a34e Remove yet more kernel header dependancies.
-Erik
2000-07-10 20:08:44 +00:00
Eric Andersen
0b4551faf5 From Matt Kraai <kraai@alumni.carnegiemellon.edu>:
Howdy,

Bug #1006 reports that

ln -s /tmp/foo .

does not work correctly.  In fact, it appears that any instantiation of

ln -s FILE... DIRECTORY

does not work.  The following patch adds support for this form, which
then fixes the particular instance noted in the bug report.

In the process, I needed the basename function.  This appears in the
string.h provided by glibc, but not uC-libc.  So I wrote my own to go in
utility.c, called get_last_path_component.  I also modified the basename
utility to use this function.

At some point it might be desirous to use the basename from the library
if it exists, and otherwise compile our own.  But I don't know how to do
this.

Matt
2000-07-10 16:44:03 +00:00
Eric Andersen
6f9985e2f2 Pavel Roskin <proski@gnu.org> just found a nasty memory
corruption bug.  Disabling 'ln -n' till it is fixed.
 -Erik
2000-06-22 00:02:56 +00:00
Eric Andersen
addc9c28ad Document 'ln --'
-Erik
2000-06-21 22:53:24 +00:00
Eric Andersen
b610615be9 Updates to a number of apps to remove warnings/compile errors under libc5.
Tested under both libc5 and libc6 and all seems well with these fixes.
 -Erik
2000-06-19 17:25:40 +00:00
Pavel Roskin
110fc0cacc Check for 3 and more arguments was incorrect
It is only allowed for linking to a directory
But linking to a directory still fails and may be removed
2000-06-18 00:02:24 +00:00
Pavel Roskin
2e965239ee ln: fixed command line parser. Added support for "--" 2000-06-15 18:04:40 +00:00
Eric Andersen
815e904470 Fixed a bunch of stuff:
* Fixed segfault caused by "touch -c"
	* Fixed segfault caused by "rm -f"
	* Fixed segfault caused by "ln -s -s" and similar abuses.
	* Fixed segfault caused by "cp -a -a" and similar abuses.
	* Implemented "rm -- <foo>"
updated docs accordingly.
 -Erik
2000-06-06 16:15:23 +00:00