Commit Graph

663 Commits

Author SHA1 Message Date
Glenn L McGrath
7ffe133864 As we no longer use function pointers for read in common archiving code
archive_xread can be replaced with bb_full_read, and archive_copy_file
with bb_copyfd*
bb_copyfd is split into two functions bb_copyfd_size and bb_copyfd_eof,
they share a common backend.
2003-11-21 22:24:57 +00:00
Glenn L McGrath
5c069aaf2f Fix up the -s option, and make usage consitent with behaviour,
patch by Steven Scholz
2003-11-20 05:58:26 +00:00
Glenn L McGrath
931ae9d2f8 woops, we needed that function 2003-11-18 23:56:41 +00:00
Glenn L McGrath
de3ea9f049 Only use getopt and associated flags if checking is enabled 2003-11-18 19:35:06 +00:00
Glenn L McGrath
aee0fd8320 Replaced by md5_sha1_sum.c 2003-11-18 19:33:13 +00:00
Glenn L McGrath
303b7d83f0 Replaced by md5_sha1_sum.c 2003-11-18 18:56:25 +00:00
Glenn L McGrath
d2a897aab0 Merge common parts of sha1sum and md5sum, which is everything except the
algorithms.
Move algorithms to hash_fd and make them available via a common
function.
2003-11-10 04:33:55 +00:00
Eric Andersen
1b1942f93d As vodz pointed out, setting unset_env to NULL is sufficient 2003-11-07 11:20:21 +00:00
Glenn L McGrath
7f9de02ca6 Rewrite, 800+ bytes smaller and more robust. 2003-11-06 03:17:23 +00:00
Eric Andersen
6d687817a8 Fix oversight with CONFIG_FEATURE_AUTOWIDTH handling 2003-11-04 23:16:48 +00:00
Eric Andersen
b7077a7316 Set unset_env pointing to a NULL item, to prevent us from walking
off the end of the list and segfaulting.
 -Erik
2003-11-03 22:46:14 +00:00
Glenn L McGrath
4ef5a84583 Move the tail -c option from FANCY_TAIL to the default tail, this makes
the default tail options conform to SUSv3, with the non-SUS
option all in FANCY_TAIL
2003-10-31 00:35:59 +00:00
Glenn L McGrath
9716575f1a Remove config options for sort -u and sort -r, they are always enabled 2003-10-31 00:04:24 +00:00
Glenn L McGrath
f4fd3a1331 Accept the -c option and do nothing 2003-10-29 11:10:02 +00:00
Eric Andersen
637d2266e1 Disable any buffering to stdout 2003-10-22 10:18:24 +00:00
Eric Andersen
88c916bdec Andreas Mohr writes:
the busybox menuconfig triggered my "inacceptable number of spelling mistakes"
upper level, so I decided to make a patch ;-)

I also improved some wording to describe some things in a better way.

Many thanks for an incredible piece of software!

Andreas Mohr, random OSS developer
2003-10-22 09:58:56 +00:00
Glenn L McGrath
a55d72bbb4 Patch from Steven Scholz, fix some warnings 2003-10-09 11:38:45 +00:00
Glenn L McGrath
a406a9c853 Add the -d option 2003-09-24 05:00:29 +00:00
Glenn L McGrath
eebcc1d98a Add the "install" applet, move get_ug_id to libbb as its used by chown,
chgrp and install.
2003-09-24 03:22:57 +00:00
Eric Andersen
8efe967018 Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
 -Erik
2003-09-15 08:33:45 +00:00
Glenn L McGrath
07f6b95d8f Patch from Jean Wolter
expr currently always adds even if told to subtract
2003-09-08 23:19:12 +00:00
Glenn L McGrath
55bf79f944 Preserve suid/sgid bits 2003-09-08 14:34:23 +00:00
Glenn L McGrath
dc4e75ef7c move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant.
Vodz last_patch_107
2003-09-02 02:36:18 +00:00
Glenn L McGrath
7b8765c808 vodz, last patch 103 2003-08-29 07:29:30 +00:00
Glenn L McGrath
c3f2956cfa Woops, depend on SHA1 not the option 2003-08-26 04:28:05 +00:00
Glenn L McGrath
4d5e4685fe SHA1 options depend on SHA1 2003-08-26 04:25:59 +00:00
Glenn L McGrath
d382c89467 Typo 2003-08-19 03:49:00 +00:00
Manuel Novoa III
5b3c05637d Remove unnecessary pointer dereference. 2003-08-13 12:11:33 +00:00
Manuel Novoa III
96379b0d7d Adjust Erik's change, as I don't claim copyright of the applet. 2003-08-09 02:57:55 +00:00
Eric Andersen
de6a6ae876 Remove unnecessary defamatory comment 2003-08-08 08:57:03 +00:00
Eric Andersen
6c0e0fb8ac Fix a stupid bug I introduced several months ago 2003-08-08 07:39:57 +00:00
Eric Andersen
05df91a3ac last_patch98 from vodz:
Denis,

># ./busybox env - echo zzz
>zzz
># ./busybox echo -n zzz
>zzz
># ./busybox env - echo -n zzz
>env: invalid option -- n
>
>       obviously, env tried to understand -n as env's option
>       instead of blindly passing it to echo...
>
>BusyBox v1.00-pre1 (2003.07.16-07:53+0000) multi-call binary
>
>Usage: env [-iu] [-] [name=value]... [command]

Ah, you found very old problem.
Last patch also have:

- multiple "-u unsetenv" support
- GNU long option support
- save errno after exec failed before bb_perror_msg()


--w
vodz
2003-07-28 07:42:19 +00:00
Eric Andersen
727f529211 There should be only one instance of CONFIG_FEATURE_AUTOWIDTH 2003-07-26 09:33:16 +00:00
Manuel Novoa III
b511f9cea9 Set the tm_isdst flag to -1 before calling mktime(). Otherwise, the current
timezone setting is used for the new date.
2003-07-23 23:24:31 +00:00
Eric Andersen
e5272074c9 eliminate DOSTATIC, DODEBUG, etc and name them sensibly 2003-07-22 22:15:21 +00:00
Eric Andersen
85e5e72bc1 Remove remaining libc5 support code 2003-07-22 08:56:55 +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
e5642119ee Patch from Thomas Cameron:
Hello all,
	    This patch adds more "Help" text to the config system.  Almost
    all applets now have a help entry.  Also, I cleaned up the spacing of
    the existing text so that things are consistent.  This patch is against
    this morning's CVS.

    Thomas Cameron
    CEI Systems, Inc.
2003-07-14 19:37:08 +00:00
Eric Andersen
b7ebc61b54 Michael Sternberg writes:
Latest BusyBox from CVS (Jul 7 2003).
    File coreutils/ls.c
    "if" at line 970 should be enclosed in #ifdef CONFIG_FEATURE_LS_SORTFILES
    "if" at line 976 should be enclosed in #ifdef CONFIG_FEATURE_LS_TIMESTAMPS
2003-07-14 19:20:46 +00:00
Eric Andersen
65e20a33c2 Patch from Kent Robotti adding a bunch of needed docs!
-Erik
2003-07-05 07:52:35 +00:00
Eric Andersen
9e48045e45 Patch from Russell Coker:
I've attached my latest SE Linux patch for busybox against the latest CVS
    version of busybox.
2003-07-03 10:07:04 +00:00
Eric Andersen
e5920a2dc0 Patch from Kent Robotti adding a bunch of menuconfig help 2003-07-03 10:00:15 +00:00
Eric Andersen
61f6db130e As implemented, sha1sum would sometimes give the wrong answer.
This fixes it and uses faster sha1 code from Dr. Gladman.
 -Erik
2003-07-03 09:41:41 +00:00
Eric Andersen
7c512439b2 Make sure we end up with a unix2dos link to busybox 2003-06-26 21:53:51 +00:00
Eric Andersen
9d7f0f0fe8 Somewhere in the 2.4.x kernel series, /proc/mounts was changed to display a
"rootfs" entry as well as the traditional "/dev/root" entry.  This caused
applets such as mount and df to display two root filesystem entries....

This teaches the relevant utilities to ignore the "rootfs" entry.
 -Erik
2003-06-20 09:36:49 +00:00
Eric Andersen
c9e7024924 Add prototype update missing from last_patch89. Fix screwy
formatting in cut.
2003-06-20 09:16:00 +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
Glenn L McGrath
6c43f743a3 sha1sum option to compare checksums 2003-06-08 13:32:12 +00:00
Glenn L McGrath
a721204ec5 Better error handling 2003-06-07 17:38:33 +00:00
Glenn L McGrath
a9e4617494 Minor correction 2003-06-07 17:11:00 +00:00
Glenn L McGrath
138d71bc35 Fix bug (wrong value computed) when reading file from stdin, implement
-s option
2003-06-07 17:06:28 +00:00
Glenn L McGrath
7aa62cf173 Run through indent 2003-06-07 14:54:24 +00:00
Eric Andersen
a2d1982841 cleanup a bit to remove needless verify() function 2003-05-26 18:09:14 +00:00
Glenn L McGrath
393183dccc Vodz, last_patch_86 2003-05-26 14:07:50 +00:00
Glenn L McGrath
7a54360cd4 Use bb_xgetlarg 2003-04-27 10:05:35 +00:00
Glenn L McGrath
f01b805d91 New applet, fold 2003-04-27 06:02:14 +00:00
Eric Andersen
982da3e6b4 Add more help text 2003-04-04 15:20:53 +00:00
Eric Andersen
4762a48166 Test that cvs commit messages are working properly
-Erik
2003-04-04 14:35:36 +00:00
Manuel Novoa III
0c236a09ed Fix 'thinko'. 2003-04-03 19:29:11 +00:00
Eric Andersen
b5b5ac3237 trivial fix to make sure we have sufficient arguments before
we mess with a possibly non-existant argv[1]
 -Erik
2003-03-28 16:54:14 +00:00
Manuel Novoa III
3a9b0bf0ba Oops... had != but meant ==. 2003-03-23 20:27:33 +00:00
Manuel Novoa III
ea4c43445c Restrict octal perms to <= 07777. Cosmetic error message change. 2003-03-19 18:09:03 +00:00
Manuel Novoa III
4eff18189a Things my compiler didn't catch... 2003-03-19 09:42:02 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Glenn L McGrath
008c01915b Fix for big endian machines 2003-02-17 12:18:16 +00:00
Glenn L McGrath
ae0f1e7052 New applet sha1sum 2003-02-17 08:23:22 +00:00
Glenn L McGrath
3238ea1673 Merge fileutils, textutils and shellutils into coreuils 2003-02-15 10:53:40 +00:00
Glenn L McGrath
a88cb5025c Patch from mathuria, compatability with solaris 2003-02-08 23:36:16 +00:00
Eric Andersen
fc4a0fd82e last_patch75_2 from vodz, 2003-01-14 18:13:13 +00:00
Glenn L McGrath
4d00129d0f Correct column width for tab completion and ls 2003-01-06 01:11:50 +00:00
Glenn L McGrath
76ff0da4d2 Support the obsolete '+' option 2002-12-23 11:54:56 +00:00
Eric Andersen
29f9b2fbdb Add missing header file to squash a warning 2002-12-11 04:25:02 +00:00
Glenn L McGrath
7b4e89b9e3 Fix undefined behaviour and save some bytes as suggested by Manuel Novoa III 2002-12-10 03:16:37 +00:00
Glenn L McGrath
62fae308a3 Realpath applet 2002-12-10 00:14:33 +00:00
Eric Andersen
b077c9f47d Fixup buffer allocation 2002-12-06 21:39:48 +00:00
Aaron Lehmann
a170e1c858 Change if(x)free(x); to free(x); 2002-11-28 11:27:31 +00:00
Glenn L McGrath
eaed78a91f Style 2002-11-28 11:05:28 +00:00
Glenn L McGrath
cdf142af90 Woops, forgot they printout applet name as well.... 2002-11-28 10:58:19 +00:00
Glenn L McGrath
d7d5f42934 Use error_msg instead of fprintf(stderr 2002-11-28 09:34:51 +00:00
Glenn L McGrath
8e027f6474 Use printf instead of fprintf(stdout 2002-11-28 08:37:46 +00:00
Glenn L McGrath
822e7fd587 When making parent directories set permissions based on the base parent tree rather than the new directory to be created. 2002-11-24 22:48:20 +00:00
Glenn L McGrath
e16860df08 Will the real od.c please stand up! (my previous commit was a mistake) 2002-11-10 22:16:09 +00:00
Glenn L McGrath
59870e89ae Prevent a segfault if no argument, by Geoffrey Lee <glee@bluesat.unsw.edu.au> 2002-11-10 21:52:59 +00:00
Eric Andersen
d274b53c1d last_patch59 from vodz to cleanup chmod and correctly parse '-rwxgoa' 2002-10-10 03:47:01 +00:00
Eric Andersen
02e6ba91e8 Vodz' last_patch57:
Hi, Erik.

    my_getpw(uid/gid) and applets used it have problem:
    if username for uid not found, applets can`t detect it
    (but code pessent). Also "%8ld " format is bad:
    spaces not required (applets have self format
    or spec format (tar applet) and overflow for "id" applet...)
    This problem also pressent in stable version.
    Patch for unstable in attach.

    --w
    vodz
2002-09-30 20:39:56 +00:00
Glenn L McGrath
924f93e848 make_directory() will fail instantly so we dont need to test for failure here 2002-09-28 08:32:14 +00:00
Eric Andersen
60943c5d5c Sane-ify the screen clearing stuff.
-Erik
2002-09-17 20:53:41 +00:00
Glenn L McGrath
18b76e6f80 Watch applet by Michael Habermann 2002-09-16 09:10:04 +00:00
Aaron Lehmann
5d3cb7cc1f move some globals to bss 2002-08-23 07:28:45 +00:00
Glenn L McGrath
acfc0d872e Run through indent, fix comments 2002-08-23 06:05:11 +00:00
Glenn L McGrath
03195fc16f Run through indent, fix comments 2002-08-23 05:58:38 +00:00
Glenn L McGrath
a199b17253 Run through indent, specify cast 2002-08-23 03:37:07 +00:00
Glenn L McGrath
14dad7028b Run through indent 2002-08-23 03:25:22 +00:00
Glenn L McGrath
e3906fcd94 Run through indent, fix BB_ define 2002-08-22 18:13:54 +00:00
Robert Griebl
6859d761d3 - updated a few copyright/left file headers
- documented most of my 0.61 changes in the ChangeLog
2002-08-05 02:57:12 +00:00
Robert Griebl
df03932b7e Added the -I (isofmt) options to date, which comes in handy for scripts
(this is a confiureable option)
2002-07-30 23:11:00 +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
2276d83639 Fixup warnings and undefined operations that show up in gcc-3.1
-Erik
2002-07-11 11:11:56 +00:00
Eric Andersen
887ca79f04 Scrub pwd.h and grp.h handling so we don't have to play any
silly games.
 -Erik
2002-07-03 23:19:26 +00:00
Eric Andersen
009ae1f17d Little fix to avoid overflow 2002-07-03 04:24:08 +00:00
Aaron Lehmann
69d4178708 Remove advertising clauses in accordance with
ftp://ftp.cs.berkeley.edu/ucb/4bsd/README.Impt.License.Change
2002-06-23 22:25:24 +00:00
Eric Andersen
b0fd2b06a3 Fix a potential macro expansion problem... isspace can be
a macro causing a double decrement...
2002-06-15 14:37:46 +00:00
Eric Andersen
a7d0b41c08 Don't use pointless GNU-isms 2002-06-15 14:33:06 +00:00
Eric Andersen
fc059090b6 last_patch41 from vodz to fix stty -F and similar 2002-06-06 11:35:29 +00:00
Manuel Novoa III
b99cb64b80 Include busybox.h before testing CONFIG_LOCALE_SUPPORT. 2002-05-29 19:08:41 +00:00
Robert Griebl
53146cc9ec Added include for isdigit(); simplified -<num> detection 2002-05-27 22:24:53 +00:00
Robert Griebl
13c26fc1a5 SUpport old style -[::digit::] options for head and tail
Also make head behave like GNU head (-0/-n 0 is valid)
2002-05-17 22:18:04 +00:00
Tim Riker
95bf6da637 fix and shrink uuencode 2002-05-01 05:57:16 +00:00
Eric Andersen
d598d41110 Fix silly combinitorial oversight 2002-04-27 09:19:39 +00:00
Eric Andersen
ef38b39262 Support noerror option 2002-04-27 01:31:43 +00:00
Eric Andersen
00a6a75035 Add the who applet, supplied by Da Chen <dchen@ayrnetworks.com> 2002-04-26 23:53:10 +00:00
Eric Andersen
5f6873621d ls could mis-color certain entries when previous commands
had failed.  Explicitly 0 out errno to prevent that.
2002-04-17 20:21:45 +00:00
Eric Andersen
1d1d2f9b18 Update some missing copyright notices 2002-04-13 08:31:59 +00:00
Eric Andersen
265d229427 Patch from Edward Betts <edward@debian.org> to add -x switch to du.c 2002-04-06 23:16:44 +00:00
Eric Andersen
fcffa2cc1a Apply lash_patch35 from vodz, which brings several nice size_optimizations. 2002-04-06 05:17:57 +00:00
Manuel Novoa III
fa15f702d2 Work around compiler/assembler problem and reduce code size at the same time. 2002-03-25 02:37:20 +00:00
Eric Andersen
27eff033d2 Eliminate extra trailing space 2002-03-20 16:10:54 +00:00
Eric Andersen
3ad0bd9563 Patch from J.W.Janssen <JanWillem.Janssen@lxtreme.nl> to provide
color ls support, modifed by me to behave properly when not running
output to a terminal (i.e. 'ls | more')
 -Erik
2002-03-20 09:13:48 +00:00
Matt Kraai
a1bbde71bf list_single: Declare scratch iff CONFIG_FEATURE_LS_USERNAME is defined. 2002-03-08 16:25:33 +00:00
Matt Kraai
3bd31ebc9a * fileutils/ls.c (showfiles): Display multiple short names on a line. 2002-03-08 16:16:38 +00:00
Matt Kraai
eb83478528 * fileutils/dd.c (dd_main): Ignore ftruncate error if the output is not a
file or directory.
2002-02-05 15:28:54 +00:00
Matt Kraai
1f0c43668a Remove == TRUE' tests and convert != TRUE' and `== FALSE' tests to use !. 2001-12-20 23:13:26 +00:00
Matt Kraai
38c15becf6 Avoid printing a trailing blank character. 2001-12-20 21:11:59 +00:00
Matt Kraai
ace02dc9cd Make cp and mv optionally preserve hard links. 2001-12-17 15:26:36 +00:00
Matt Kraai
741f40b58e Use an int to hold the result of fgetc (bug noted by David Kimdon). 2001-12-11 16:06:02 +00:00
Matt Kraai
dba11452cb Continue processing files if we are asked to touch, but not create, a file
which doesn't exist.
2001-12-07 21:27:38 +00:00
Matt Kraai
3eeab3b23f Update copyright and close file descriptors (noted by Axel Kittenberger). 2001-12-07 16:27:37 +00:00
Eric Andersen
c98c06233e Merge in the cal applet from Steve Merrifield <steve@labyrinth.net.au> 2001-12-06 15:16:43 +00:00
Manuel Novoa III
6509f92a3b Combined size reduction changes by Glenn and myself. Added back in "unknown"
for -p to match normal uname behavior (at a cost of 30-40 bytes).
2001-12-05 04:21:30 +00:00
Glenn L McGrath
9e6c9f7311 Minor space saving improvments 2001-11-21 12:46:36 +00:00
Glenn L McGrath
74afa9aed1 When just counting chars of a file stat file instead of reading the whole file (Fixes Debian bug #103302) 2001-11-21 10:26:28 +00:00
Glenn L McGrath
c29ab97094 woops. dotn pass NULL 2001-11-21 10:01:29 +00:00
Glenn L McGrath
1477ad8e83 Simplify print function, prints an extra space if no filename, but saves 4 bytes 2001-11-21 09:58:29 +00:00
Glenn L McGrath
02d090d3d2 Use enums for selected functionality, Reduce the size by nearly 100 Bytes 2001-11-21 09:17:00 +00:00
Eric Andersen
26f8e95d2d David Kimdon <dwhedon@instant802.com> noticed a thinko
in md5sum where only binary sums were verified.  He also
sent in this patch,
 -Erik
2001-11-17 04:16:15 +00:00
Glenn L McGrath
60281118d0 Introduce od and hexdump applets 2001-11-02 11:39:46 +00:00
Eric Andersen
eaecbf33f7 Fixup some silly prototype warnings 2001-10-31 10:41:31 +00:00
Matt Kraai
258bd3d971 Split true and false into separate applets. 2001-10-24 19:00:20 +00:00
Eric Andersen
1a10eec178 Fixup the location of pwd.h and grp.h 2001-10-24 17:19:38 +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
74400ccfd0 Scrub up some function prototypes.
-Erik
2001-10-18 04:11:39 +00:00
Glenn L McGrath
1d098cefe2 Use wfopen instead of fopen & error_msg, saves 64 bytes 2001-10-05 05:24:19 +00:00
Matt Kraai
4c557bf576 Invert FILEUTILS_PRESERVE_SYMLINKS into FILEUTILS_DEREFERENCE. 2001-10-05 01:35:10 +00:00
Matt Kraai
1350666498 Add -p support. 2001-08-29 21:18:47 +00:00
Matt Kraai
5171bf6d40 SUSv2 specifies that if the extension is identical to the basename, it
should not be removed.
2001-08-29 20:19:29 +00:00
Eric Andersen
59443965ad Scrub things and ditch uint64_t and use a custom type name
to avoid C lib compatibility problems.
2001-08-22 05:06:29 +00:00
Eric Andersen
c61804ed59 Fix dos2unix compile problem with certain glibc versions 2001-08-21 22:34:05 +00:00
Matt Kraai
d0b5be6da8 Remove BB_SH define entirely. 2001-08-09 21:00:15 +00:00
Matt Kraai
2338d3176b Use ferror(3) to check for errors, rather than inspecting errno. Thanks to
David Douthitt for reporting, and shame on me for writing such crappy code.
2001-08-06 16:09:09 +00:00
Eric Andersen
0b7d70c822 Fix up some silly messups with the debian packaging, and a dumb
bug with chroot.  I've had the package uploaded but perms set to
000, so I am going to re-tag things and re-cut the release.  Folks
who pulled from CVS in the last 30 minutes with just have to cope.
 -Erik
2001-08-02 20:56:16 +00:00