Commit Graph

109 Commits

Author SHA1 Message Date
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
Eric Andersen
3312c989e6 fix 'grep -C' which requires an argument 2006-09-25 22:18:56 +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
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
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
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
"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
"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
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"
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
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
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
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
c5408fe7f7 Fix segfault when cleaning up 2003-04-27 02:22:01 +00:00
Glenn L McGrath
26df70a823 grep -f support, adds only 60 Bytes, but regex's now compiled as
required, rather than being pre-compiled.
2003-04-27 01:50:57 +00:00
Manuel Novoa III
cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Aaron Lehmann
a170e1c858 Change if(x)free(x); to free(x); 2002-11-28 11:27:31 +00:00
Matt Kraai
eed9451cf6 * findutils/grep.c (grep_main): Remove unnecessary use of junk. 2002-02-22 22:08:16 +00:00
Matt Kraai
585f657e2d Fix undeclared variable error. 2001-11-20 16:00:44 +00:00
Eric Andersen
81ee96fe62 Usr get_last_path_component() name basename() 2001-11-20 00:23:48 +00:00
Eric Andersen
6f8b7ea452 oops 2001-11-19 11:45:39 +00:00
Eric Andersen
55805bcba4 More scrubbing 2001-11-19 10:59:37 +00:00
Eric Andersen
43626d7671 Fixup CLEANUP behavior 2001-11-19 10:36:20 +00:00
Matt Kraai
a21c24bf03 Convert strdup call to xstrdup, and calloc calls to xcalloc (patch from
Steve Merrifield).
2001-11-12 16:58:07 +00:00
Eric Andersen
dba4e6f046 Add in grep -E support 2001-11-10 12:54:00 +00:00
Matt Kraai
bb0088e980 Make egrep only set REG_EXTENDED flag. 2001-10-31 16:16:31 +00:00
Eric Andersen
ccd96f1972 Patch from Charles Steinkuehler <charles@steinkuehler.net>
to properly handle extended regexps for egrep
2001-10-31 10:02:46 +00:00
Matt Kraai
999623e973 Use extended regular expressions when invoked as egrep (noted and initial
patch by Charles Steinkuehler).
2001-10-29 15:49: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
Eric Andersen
74400ccfd0 Scrub up some function prototypes.
-Erik
2001-10-18 04:11:39 +00:00
Eric Andersen
0034443140 Fix behavior of grep -lc to match GNU grep. SuS2 is ambiguous
on the correct behavior, so acting like GNU grep seems best
 -Erik
2001-07-31 23:18:49 +00:00
Eric Andersen
86f0167e39 grep failed to compile when BB_FEATURE_CLEAN_UP was defined -- types were wrong. 2001-05-29 22:36:39 +00:00
Mark Whitley
fa43e54b6f Added support for grep -e and grep -f, closes bug #1164. Also added some
testcases for these new features.
2001-05-24 18:36:18 +00:00