Commit Graph

683 Commits

Author SHA1 Message Date
Mike Frysinger
db289b258d use CONFIG_BUFFER macros like cow suggested and shrink code size some more by using less variables and more gotos ;) 2005-09-10 04:10:18 +00:00
Rob Landley
98ea849623 Patch from Dirk Clemens so df doesn't run numbers together on drives >100gig. 2005-09-10 02:59:35 +00:00
Mike Frysinger
a80b290e30 some tweaks by cow to shrink a little 2005-09-10 02:47:19 +00:00
Manuel Novoa III
415f6c9628 Rob, I don't know why you feel some unexplainable compulsion to get rid of
a meaningless warning.  But I do expect you preserve the coding style
and variable names when all you're doing is tweaking some of my code.

I repeat... do NOT change whitespace, variable names, or coding style in
any of my code simply to conform to your coding style.
2005-09-08 06:02:49 +00:00
Rob Landley
14efdc58ce Don't comment warnings. Don't put #warnings about warnings. _FIX_ warnings.
This fixes the warning, and makes the binary smaller out of sheer pique.
(Yes, since Manuel did this one it's nice tight code that took several
attempts to shrink, but I was ticked.)

Add the start of a test for uniq; this is about the first 1/3 of the
tests we need for full susv3 coverage of uniq.
2005-09-07 04:18:36 +00:00
Rob Landley
1283a150ae Whitespace-level changes. Replace s0,s1,e0,e1 with real variable names and
clean up whitespace and curly brackets a bit.  Resulting binary should be
identical.
2005-09-06 01:57:11 +00:00
"Vladimir N. Oleynik"
a8c23aa795 - usage fresh bb_getopt_ulflags for ls -- very size reduce.
- small indent corrections
- remove unecessary malloc and free
2005-09-05 15:06:57 +00:00
"Vladimir N. Oleynik"
27421a1878 1) bb_opt_complementaly -> bb_opt_complementally
2) better support long options
3) new flag '!' for bb_opt_complementally: produce bb_show_usage() if BB_GETOPT_ERROR internally
2005-09-05 14:46:07 +00:00
Rob Landley
f815469a76 Bernhard Fischer trimmed down dos2unix a bit. 2005-09-01 03:11:19 +00:00
Rob Landley
58a651b2e5 Very minor tweak to tail. 2005-08-13 00:35:00 +00:00
Rob Landley
6a6798b8e4 Major rewrite of mount, umount, losetup. Untangled lots of code, shrunk
things down a bit, fixed a number of funky corner cases, added support for
several new features (things like mount --move, mount --bind, lazy unounts,
automatic detection of loop mounts, and so on).  Probably broke several
other things, but it's fixable.  (Bang on it, tell me what doesn't work for
you...)

Note: you no longer need to say "-o loop".  It does that for you when
necessary.

Still need to add "user mount" support, which involves making mount suid.  Not
too hard to do under the new infrastructure, just haven't done it yet...

The previous code had the following notes, that belong in the version
control comments:

- * 3/21/1999   Charles P. Wright <cpwright@cpwright.com>
- *             searches through fstab when -a is passed
- *             will try mounting stuff with all fses when passed -t auto
- *
- * 1999-04-17  Dave Cinege...Rewrote -t auto. Fixed ro mtab.
- *
- * 1999-10-07  Erik Andersen <andersen@codepoet.org>.
- *              Rewrite of a lot of code. Removed mtab usage (I plan on
- *              putting it back as a compile-time option some time),
- *              major adjustments to option parsing, and some serious
- *              dieting all around.
- *
- * 1999-11-06  mtab support is back - andersee
- *
- * 2000-01-12   Ben Collins <bcollins@debian.org>, Borrowed utils-linux's
- *              mount to add loop support.
- *
- * 2000-04-30  Dave Cinege <dcinege@psychosis.com>
- *             Rewrote fstab while loop and lower mount section. Can now do
- *             single mounts from fstab. Can override fstab options for single
- *             mount. Common mount_one call for single mounts and 'all'. Fixed
- *             mtab updating and stale entries. Removed 'remount' default.
- *
2005-08-10 20:35:54 +00:00
Paul Fox
0b62158475 implemented a builtin echo command in ash. moved the guts of the
echo applet into libbb, and now call bb_echo() from both echo.c
and ash.c
2005-08-09 19:38:05 +00:00
Paul Fox
156dc41cbc commiting patch from bug 71:
0000071: patch: implement "--color" option for ls coloring control
2005-08-01 19:33:30 +00:00
Mike Frysinger
0d3ca7289e tell people to ignore the dups/e0 warnings 2005-07-30 08:59:38 +00:00
Mike Frysinger
4d00896d05 use toplevel ARFLAGS and update default ARFLAGS to be quiet 2005-07-27 01:09:24 +00:00
Mike Frysinger
dbc049fda4 remove unused variable ret as reported by apgo in Bug 350 and touchup syntax along the way 2005-07-26 22:57:51 +00:00
Mike Frysinger
726b2cb5da just punt all the f_frsize crap since not all linux headers support it Bug 346 2005-07-26 22:39:56 +00:00
Paul Fox
4905434b8a applying fix for:
0000265: tail -f should keep following files even if they
                    were truncated
2005-07-20 19:46:32 +00:00
Paul Fox
379ac89c30 applying patch from:
0000227: sort use wrong type for getopt return variable
2005-07-20 19:07:27 +00:00
Rob Landley
3c12ff7c89 If /tmp and /home were different partitions, then "mv /tmp/file /home/file"
would delete /home/file even if /tmp/file didn't exist.

This fixes that, although the logic of both mv and cp is a bit tangled and
should probably be untangled.
2005-07-20 00:45:40 +00:00
Mike Frysinger
8deb686d2e Patch by jonlar in Bug 312 to split the U_W_TMP feature into sep UTMP and WTMP options 2005-07-01 01:04:32 +00:00
Mike Frysinger
a87bb60809 patch by Shaun Jackman to combine dup/close funcs into dup2 2005-06-30 03:43:14 +00:00
Mike Frysinger
8804c6a3b7 dont use f_frsize unless linux-2.6.0 or better 2005-06-29 01:07:04 +00:00
Mike Frysinger
9e164578f2 tweak signed/unsigned char usage to avoid mismatches 2005-06-24 21:37:59 +00:00
Rob Landley
f7662da2af Shaun Jackman submitted a patch converting an allocation to use
CONFIG_RESERVE_BUFFER.  (Rob Landley removed an #ifdef, per discussion on
the list.)
2005-05-28 23:55:26 +00:00
Rob Landley
47bc802e9e Patch from Shaun Jackman to save a few bytes. 2005-05-28 23:36:38 +00:00
Mike Frysinger
1fb7961e08 use more busybox functions and remove redundant code 2005-05-16 22:35:59 +00:00
Mike Frysinger
1ece21bddd as Rob Landley pointed out, need to fix the 1 versus i typo in indexing 2005-05-13 03:09:20 +00:00
Mike Frysinger
0fb397e617 blah, forgot to save last time to fix whitespacing 2005-05-13 00:58:18 +00:00
Mike Frysinger
867a6080fe remove duplicated code and rework algorithms to end up with smaller code 2005-05-13 00:57:30 +00:00
Mike Frysinger
dad4cf7e63 use a bunch of if statements since it is a few bytes smaller than a switch; also use bb_xfopen() instead of fopen() so comm doesnt segfault when given non-existant files :( 2005-05-12 22:50:12 +00:00
Mike Frysinger
b3a6ec3e62 err, added 2 to the wrong var :) also touchup the option detection to shrink size 2005-05-12 22:41:13 +00:00
Mike Frysinger
3ba93c0438 fix segfault if user only specifies 1 file 2005-05-12 22:36:32 +00:00
Mike Frysinger
0d605e98b2 fix whitespace/coding style 2005-05-12 22:25:41 +00:00
Mike Frysinger
a84a512700 add missing comm.o rule 2005-05-12 22:23:15 +00:00
Mike Frysinger
5b300dd3a9 whitespace touchups 2005-05-12 22:22:50 +00:00
Rob Landley
2acfd7bd26 Small comm implementatin from Rob Sullivan. Needed to build perl. 2005-05-11 23:12:49 +00:00
Mike Frysinger
348e84c202 change the hardcoded error constant (0x80000000UL) to a nice flexible define (BB_GETOPT_ERROR) 2005-05-11 00:39:03 +00:00
Rob Landley
540d3f60f3 Patch from Shaun Jackman:
> This patch modfies expr to use portable POSIX regex rather than BSD
> regex.
...
> This updated patch implements an anchored regex by checking that the
> match starts at offset 0.

More to the point, this patch uses the same regex that sed.c is already using
(opportunity to suck in less library code), and even building a dynamically
linked busybox with just expr the result is a slightly smaller binary (by 94
bytes, I dunno what nm --size-sort has to say about it because I didn't build
with debug info, since that changes the binary size a lot by disabling
optimization...)

Your mileage may vary.  Handle with caution.  Do not taunt happy fun ball.
2005-05-09 21:42:42 +00:00
Rob Landley
b9dfb8c03f Manuel points out that if printf needs a flush to act like dprintf, the result
is bigger.  Revert last patch.
2005-05-07 17:45:38 +00:00
Rob Landley
cce1ae2ce5 Shaun Jackman pointed out that dprintf(STDOUT_FILENO,...) is just a printf. 2005-05-07 07:53:16 +00:00
Rob Landley
60158cb93e A patch from Takeharu KATO to update/fix SE-Linux support. 2005-05-03 06:25:50 +00:00
Rob Landley
6624daeb4d On Wednesday 13 April 2005 09:12 pm, Shaun Jackman wrote:
> This patch fixes a memory leak in hash_file by using the BUFFER macros
> instead of xmalloc. Please apply.
2005-04-30 05:11: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
Mike Frysinger
edb3fbc305 fix stupid build mistake i made earlier as pointed out by psm 2005-04-26 00:43:19 +00:00
Mike Frysinger
408ae211ce rework human_fstype to cut down size 2005-04-24 04:11:44 +00:00
Mike Frysinger
f06c494636 rework options to get rid of extra variables 2005-04-24 03:53:12 +00:00
Mike Frysinger
9b5f71ec02 stat implementation based upon coreutils 2005-04-23 06:26:38 +00:00
Mike Frysinger
5b2e27137d cast the time pointer so gcc stops warning over nothing 2005-04-23 01:42:03 +00:00
Mike Frysinger
5cfa5ef6f3 use bb_fflush_stdout_and_exit instead of exit 2005-04-23 01:41:51 +00:00