Commit Graph

297 Commits

Author SHA1 Message Date
Bernhard Reutner-Fischer
3e816c1252 - fold recurse, depthFirst and dereference params into one param flags.
Minor size improvement (-16b for size, -24b according to bloat-o-meter).
2007-03-29 10:30:50 +00:00
Denis Vlasenko
f8ea0f3a66 grep: "implement" -a and -I by ignoring them 2007-02-25 02:38:54 +00:00
Denis Vlasenko
385304d449 grep: implement -w 2007-02-25 02:38:20 +00:00
Denis Vlasenko
4222ae440a ash: replace xstrdup (shell shall not die)
grep: fix mis-indented block
2007-02-25 02:37:49 +00:00
Denis Vlasenko
b292264bfd find: fix -not support 2007-02-06 17:38:29 +00:00
Denis Vlasenko
1d76f439da EXEC_PREFER_APPLETS support by Gabriel L. Somlo <somlo@cmu.edu> 2007-02-06 01:20:12 +00:00
Bernhard Reutner-Fischer
7154b99c89 - improve wording 2007-02-04 17:24:53 +00:00
Bernhard Reutner-Fischer
01986e9c6f - remove duplicate menu entry 2007-02-04 17:21:55 +00:00
Denis Vlasenko
cf787cf3a5 find: support for ! 2007-02-04 17:11:25 +00:00
Bernhard Reutner-Fischer
10b7996c1b - strip 12 bytes off by using a smaller type for need_print.
- add TODO to switch this applet to index_in_str_array()
2007-02-04 16:09:04 +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
4c97863109 assorted fixes for bugs found with randomconfig 2007-02-03 03:31:13 +00:00
Denis Vlasenko
a100707c04 find -user support by Natanael Copa <natanael.copa@gmail.com> 2007-02-02 01:17:52 +00:00
Denis Vlasenko
ab2aea4447 preparatory patch for -Wwrite-strings #4 2007-01-29 22:51:58 +00:00
Denis Vlasenko
b6aae0f381 preparatory patch for -Wwrite-strings #2 2007-01-29 22:51:25 +00:00
Denis Vlasenko
434ad5456b fix warning in find.c 2007-01-27 13:45:17 +00:00
Denis Vlasenko
fc7f92253a find: fix -mtime, -mmin, -perm (+ add symbolic perm handling)
chmod: better name for a variable
2007-01-26 23:00:05 +00:00
Denis Vlasenko
769d1e05e6 fix warning from needlessly-global functions 2007-01-22 23:04:27 +00:00
Denis Vlasenko
c9d34da375 find: fix misplaced #else (fix by Harald Kuthe <trhoudini@hotmail.com>) 2007-01-03 03:15:58 +00:00
Denis Vlasenko
666da5e2c6 merge post-1.3.0 fixes 2006-12-26 18:17:42 +00:00
Denis Vlasenko
9ac9e55e3c sum: 40% size reduction (-300 bytes)
find: one_char -> LONE_CHAR
2006-12-23 15:58:11 +00:00
Denis Vlasenko
8f6c79240d find: fix spurious -exec error messages
(bug reported by Bernhard Fischer <rep.nop@aon.at>)
2006-12-23 00:49:10 +00:00
Denis Vlasenko
4cccc03768 remove useless casts (type*) xzalloc(...) 2006-12-22 18:37:07 +00:00
Denis Vlasenko
5fa7148761 build system: add "release" target
find: support -size N (needed for above)
2006-12-12 22:31:15 +00:00
Denis Vlasenko
9225854144 mostly style fixes 2006-11-01 10:25:35 +00:00
Denis Vlasenko
31c65f2456 find: -type T was actually meaning ! -type T!
With this fix, "make mrproper" works correctly
2006-10-31 23:39:37 +00:00
Denis Vlasenko
5f18e7ca33 find: implement -prune. "make clean" now works! :) 2006-10-31 03:21:02 +00:00
Denis Vlasenko
a3b4fed8b3 find: fix implicit -print (sometime differed from standard) 2006-10-31 03:20:13 +00:00
Denis Vlasenko
6191a7a007 find: implement ( ) 2006-10-30 02:10:47 +00:00
Denis Vlasenko
5d499e1600 find: a lot more compliant to 'standard' find
(we were not respecting order of actions!).
Add -o and -a handling.
2006-10-29 19:07:01 +00:00
Denis Vlasenko
e2fb719ba3 find: small improvement 2006-10-29 19:03:56 +00:00
Denis Vlasenko
df0553bbd2 find: fix -exec to work like stock find does. 2006-10-29 00:21:47 +00:00
Denis Vlasenko
8c35d65c43 recursive_action: add depth param
chmod: match coreutils versus following links
2006-10-27 23:42:25 +00:00
Denis Vlasenko
ddec5af6b0 rename functions to more understandable names 2006-10-26 23:25:17 +00:00
Denis Vlasenko
2295b49169 grep: "grep -h pattern file1 file2" ignored -h
(precluded kernel's "make modules")
2006-10-22 11:42:51 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
bf39216cc4 grep: -r didn't close files, producing "Too many open files" 2006-10-15 18:38:01 +00:00
Denis Vlasenko
3544ae6004 grep: fix combination of -r and -h 2006-10-14 14:51:59 +00:00
Denis Vlasenko
3a6755f56f grep: add support for -r 2006-10-14 14:24:30 +00:00
Denis Vlasenko
2d5ca60bfb bb_get_[chomped]line_from_file wasn't descriptive enough.
Renaming...
2006-10-12 22:43:20 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Denis Vlasenko
7d219aab70 build system overhaul 2006-10-05 10:17:08 +00:00
Denis Vlasenko
8f8f268cfd bb_applet_name -> applet_name 2006-10-03 21:00:43 +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
Denis Vlasenko
9275814a9e lots of silly indent fixes 2006-10-03 19:56:34 +00:00
Denis Vlasenko
6c30db8bd3 grep: add help text; fix style 2006-09-29 21:04:12 +00:00
Denis Vlasenko
51937534fb grep: implement -o option. Patch by Jac Goudsmit. 2006-09-29 20:58:53 +00:00
Denis Vlasenko
6248a734e2 xargs: simplify option parsing 2006-09-29 08:20:30 +00:00
Eric Andersen
3312c989e6 fix 'grep -C' which requires an argument 2006-09-25 22:18:56 +00:00
Rob Landley
e9a7a6212b Change license statements (and clean up headers) on some of the files that
Erik or I are primary copyright holders on.
2006-09-22 02:52:41 +00:00
Bernhard Reutner-Fischer
7fee0c4357 - fix copy'n paste errors that got introduced when switching to the shorter boilerplate.
No object code changes.
2006-09-13 16:39:19 +00:00
Rob Landley
081e38483e Remove xcalloc() and convert its callers to xzalloc(). About half of them
were using "1" as one of the arguments anyway, and as for the rest a multiply
and a push isn't noticeably bigger than pushing two arguments on the stack.
2006-08-03 20:07:35 +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
Mike Frysinger
441bfbf143 make the -0 xargs option a little more clear 2006-07-03 05:19:44 +00:00
Bernhard Reutner-Fischer
19008b8373 - reuse strings and messages. Saves about 600B 2006-06-07 20:17:41 +00:00
Bernhard Reutner-Fischer
e15d7573a1 - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
2006-06-02 20:56:16 +00:00
Bernhard Reutner-Fischer
95a040fac8 - use the defines CURRENT_TTY and VC_1; also shrink xargs a tiny bit:
add/remove: 0/0 grow/shrink: 2/6 up/down: 5/-37 (-32)
function                                     old     new   delta
static.add_interface                         271     274      +3
static.glob3                                  36      38      +2
static.renice_main                           409     408      -1
static.readcmd                              1083    1081      -2
static.changepath                            176     174      -2
static.parse_opts                             56      51      -5
static.rx_main                              1095    1088      -7
static.xargs_main                            759     739     -20
----------------------------------------------------------------
Result                                                :-)    -32
2006-05-27 09:36:43 +00:00
Rob Landley
8bb50782a5 Change llist_add_* to take the address of the list rather than returning the new
head, and change all the callers.
2006-05-26 23:44:51 +00:00
Mike Frysinger
39440e520c pull Rules.mak from top_srcdir as pointed out by Robert P. J. Day on the mailing list 2006-05-13 02:33:09 +00:00
Paul Fox
d7384296f6 implement -print0 for find 2006-05-12 14:47:20 +00:00
Rob Landley
2ec922eed5 Patch from Robert P Day: let menuconfig indent stuff for us, we don't have
to do it in Config.in.
2006-04-13 23:22:16 +00:00
Paul Fox
8416a2d558 prevent find from ever descending into an xdev'ed directory. 2006-03-27 16:42:33 +00:00
Bernhard Reutner-Fischer
df10094870 - revert back to r14406 2006-03-13 19:04:00 +00:00
Rob Landley
c5b1d4d6b1 Patch from Denis Vlasenko to add xstat() and use it. 2006-03-13 15:45:16 +00:00
Bernhard Reutner-Fischer
07a79e75f5 - backout using features which are not available with the previous stable
version of make (3.71.1).
2006-03-09 09:03:37 +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
Bernhard Reutner-Fischer
022eb311d5 - use absolute path for top_builddir and top_srcdir.
Fixes make trying to include the very same file in an endless loop.
2006-03-02 17:33:25 +00:00
Bernhard Reutner-Fischer
5d26126b9e - fixes parallel builds (make -j)
- use less resources for the buildsystem itself
2006-03-01 22:54:48 +00:00
"Vladimir N. Oleynik"
716bbe96d4 make grep faster (close bug 758), reduce small memory leak in CONFIG_FEATURE_CLEANUP mode 2006-02-28 10:10:19 +00:00
Rob Landley
d6e14d8bee Don't build directory libraries unless we're building an applet that needs it.
Cherry-picked from Devin Bayer's big MacOS X patch.
2006-02-21 19:11:35 +00:00
Mike Frysinger
b38673fb9f make the build system puuuuuuuuuuurty 2006-02-02 01:41:53 +00:00
"Vladimir N. Oleynik"
59c4e5cf92 removed warning "comparison between signed and unsigned". Added ATTRIBUTE_UNUSED. My whitespace 2006-01-30 13:51:50 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Bernhard Reutner-Fischer
7ca61b6f33 - shared libbusybox.
- IMA compilation option (aka IPO, IPA,..)
Please holler if i broke something..
2006-01-15 14:04:57 +00:00
Paul Fox
72d1a2357d add find's "-mmin" option. configurable. 2006-01-13 21:05:41 +00:00
"Vladimir N. Oleynik"
f704b27b5b - new bb_opt_complementally syntax, use [-:?] only - 'free' chars
- new bb_getopt_ulflags features: check max and min args, convert first argv to options special for ar and tar applets
- use bb_default_error_retval for env applet
2005-10-14 09:56:52 +00:00
Rob Landley
cee605c525 The supposedly trivial CONFIG->ENABLE conversion wasn't so trivial. The
-exec feature shouldn't be tangled up with this, so revert everything but
the new exec feature for the moment.
2005-10-06 16:39:17 +00:00
Rob Landley
5d3a0e8ed3 Add find -exec support from Rob Sullivan, and convert CONFIG_ to ENABLE_
while we're in the area.
2005-10-04 03:34:39 +00:00
Mike Frysinger
62f18e1f20 use the shorter license header 2005-09-24 07:16:29 +00:00
Mike Frysinger
0d4ee68be5 use brief license line 2005-09-24 06:01:57 +00:00
Bernhard Reutner-Fischer
aaf0e23330 - replace variables by defines to save space
- rename string denoting stdin from "-" to "(standard input)" to match
  GNU grep.
2005-09-23 15:38:49 +00:00
"Vladimir N. Oleynik"
bf4497406f SUSv3 -q compatibily exit status correction for grep again 2005-09-23 13:50:24 +00:00
"Vladimir N. Oleynik"
c96b703ab0 SUSv3 -q compatibily exit status correction for grep 2005-09-23 13:44:03 +00:00
"Vladimir N. Oleynik"
cf40d8175b grep must have exit code >1 if input file not found. Small indent correcion also. 2005-09-23 13:23:15 +00:00
"Vladimir N. Oleynik"
007a011647 network "default" --> bb_INET_default. Reduce 2 exported from find applet 2005-09-22 11:11:11 +00:00
"Vladimir N. Oleynik"
23f62fc6f3 split libbb: moved xregcomp separatelly for speed up recompile 2005-09-14 16:59:11 +00:00
"Vladimir N. Oleynik"
b4f3cff6f5 removed strange extern void xregcomp(... from some applets, but declared from libbb.h 2005-09-14 16:22:50 +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
Mike Frysinger
15ca58648a patch by srowe in Bug 359 to fix fgrep aliasing 2005-07-31 22:41:05 +00:00
Mike Frysinger
4d00896d05 use toplevel ARFLAGS and update default ARFLAGS to be quiet 2005-07-27 01:09:24 +00:00
Eric Andersen
14f5c8d764 Patch from Bernhard Fischer to make a bunch of symbols static
which were otherwise cluttering the global namespace.
2005-04-16 19:39:00 +00:00
Mike Frysinger
5ba5f4d2e7 In Bug 78, shortkey points out:
If you run `grep -h . file1 file2 file3 ...`, the output is not prefixed 
with the filename.  If you run `grep -h . file1` however, the filename 
will incorrectly prefix the output.
2005-04-16 04:56:11 +00:00
Eric Andersen
31c27a9c65 Hiroshi Ito writes:
Hello

    I'm using busy box on mipsel machine.

    "grep -f file" will cause segmentation fault.

Vladimir N. Oleynik writes:

Hiroshi,

Thank for bug report, but your patch is full broken.
Worked patch attached.
(really changes is zero initialize, and indent correcting).


--w
vodz
2004-10-08 08:10:57 +00:00
Eric Andersen
7daa076d3e egor duda writes:
Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor
2004-10-08 07:46:08 +00:00
Eric Andersen
abc513a90f Make the grep option values a bit less horrible 2004-05-26 11:48:29 +00:00
Eric Andersen
dec7f81370 Rick Richardson writes:
Here is a patch that adds egrep -L support (the opposite of egrep -l).

I realize this is probably too late for 1.0.  But I offer it for your
future consideration.

egrep -L is used in some networking startup scripts I inherited.

-Rick
2004-05-26 11:47:55 +00:00
Eric Andersen
7f164cd052 Patch from vodz to correct 'grep -e pattern1 -e pattern2' logic 2004-05-26 09:46:41 +00:00
Eric Andersen
aff114c33d Larry Doolittle writes:
This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry
2004-04-14 17:51:38 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Eric Andersen
252183e3f5 Try to make indent formatting less horrible 2003-10-31 08:19:44 +00:00