aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
AgeCommit message (Collapse)Author
2001-11-19More scrubbingEric Andersen
2001-11-19Fixup CLEANUP behaviorEric Andersen
2001-11-12Convert strdup call to xstrdup, and calloc calls to xcalloc (patch fromMatt Kraai
Steve Merrifield).
2001-11-10Add in grep -E supportEric Andersen
2001-10-31Make egrep only set REG_EXTENDED flag.Matt Kraai
2001-10-31Patch from Charles Steinkuehler <charles@steinkuehler.net>Eric Andersen
to properly handle extended regexps for egrep
2001-10-29Use extended regular expressions when invoked as egrep (noted and initialMatt Kraai
patch by Charles Steinkuehler).
2001-10-24Major rework of the directory structure and the entire build system.Eric Andersen
-Erik
2001-10-18Scrub up some function prototypes.Eric Andersen
-Erik
2001-07-31Fix behavior of grep -lc to match GNU grep. SuS2 is ambiguousEric Andersen
on the correct behavior, so acting like GNU grep seems best -Erik
2001-05-29grep failed to compile when BB_FEATURE_CLEAN_UP was defined -- types were wrong.Eric Andersen
2001-05-24Added support for grep -e and grep -f, closes bug #1164. Also added someMark Whitley
testcases for these new features.
2001-05-22Fixed extra -- lines (noted by Christophe Boyanique).Matt Kraai
2001-05-21Fixed mishandling of -c & -l options and accounted for case when we'reMark Whitley
grepping only one file.
2001-05-16Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.cMatt Kraai
by Larry Doolittle.
2001-05-14Fixed a subtle bug in the handling of -l and -c flags.Mark Whitley
2001-04-17The tiniest of bracket-placement fixes.Mark Whitley
2001-04-09Make 'grep -l' workEric Andersen
2001-04-09Fixed option parsing. Grep would continue grepping, even when given a bad /Mark Whitley
invalid option. Closes bug #1146.
2001-02-14This patch, put together by Manuel Novoa III, is a merge of workEric Andersen
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-09Implemented -A, -B, and -C flags with BB_FEATURE_GREP_CONTEXT option set.Mark Whitley
2001-02-01Tightened things up a bit, saved 20 bytes, and made the code a bit clearer inMark Whitley
the process.
2001-02-01Fix wget error message and add (and use) chomp library function.Matt Kraai
2001-01-27Fix up copyright msgs. Bump version to 0.49 in preparation forEric Andersen
a release. Update the website with release details. -Erik
2001-01-27Fix header file usage -- there were many unnecessary header files included inEric Andersen
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-04Changed email address to codepoet.org, updated list of applets / docs IMark Whitley
maintain in AUTHORS.
2001-01-04Fixed -qv interaction (thanks to a report and patch from David Douthitt).Matt Kraai
2000-12-18Change calls to error_msg.* and strerror to use perror_msg.*.Matt Kraai
2000-12-07Changed names of functions in utility.c and all affected files, to makeMark Whitley
compliant with the style guide. Everybody rebuild your tags file!
2000-10-13Fix handling of ^$ by removing the newline from input lines and by notMatt Kraai
compiling with REG_NEWLINE.
2000-09-25Renamed "internal.h" to the more sensible "busybox.h".Eric Andersen
-Erik
2000-08-06Exit with the appropriate value when grepping multiple files.Matt Kraai
2000-07-19Centralize handling of --help.Matt Kraai
2000-07-18Consolodated some common code into print_matched_line to make 'grep_file' aMark Whitley
little more terse & clean. Also made a few minor formatting changes.
2000-07-18Added support for the -c (count matches) option. Made it so it works just likeMark Whitley
GNU grep.
2000-07-16Extract usage information into a separate file.Matt Kraai
2000-07-14Use errorMsg rather than fprintf.Matt Kraai
2000-07-12Changed bb_regcomp to xregcomp and #if 0'ed out destroy_cmd_strs in sed.cMark Whitley
(maybe I'll remove it later).
2000-07-11Applied patch from Matt Kraai which does the following:Mark Whitley
- adds case-insensitive matching in sed s/// epxressions - consolodates common regcomp code in grep & sed into bb_regcomp and put in utility.c - cleans up a bunch of cruft
2000-07-10Applied patch from Matt Kraai as per his email:Mark Whitley
However, the case of grep foo$ file didn't work, due to a problem with the flags used in regular expression compilation. The attached patch fixes this problem. ---patch------- Index: grep.c =================================================================== RCS file: /var/cvs/busybox/grep.c,v retrieving revision 1.30 diff -u -r1.30 grep.c --- grep.c 2000/07/04 22:17:01 1.30 +++ grep.c 2000/07/10 08:57:04 @@ -141,8 +141,10 @@ if (argv[optind] == NULL) usage(grep_usage); - /* compile the regular expression */ - reflags = REG_NOSUB; /* we're not going to mess with sub-expressions */ + /* compile the regular expression + * we're not going to mess with sub-expressions, and we need to + * treat newlines right. */ + reflags = REG_NOSUB | REG_NEWLINE; if (ignore_case) reflags |= REG_ICASE; if ((ret = regcomp(&regex, argv[optind], reflags)) != 0) { ---patch------- Thanks, Matt, it works great.
2000-07-09include getopt.hEric Andersen
-Erik
2000-07-04Some cosmetic updates. Changed "OPTIONS" to "Options".Eric Andersen
-Erik
2000-06-28Fixed comment.Mark Whitley
2000-06-28Added support for reading from stdin with '-' as file name arg.Mark Whitley
2000-06-28Yanked out the cstring_alloc() and cstring_lineFromFile() functions fromMark Whitley
utility.c and replaced them with get_line_from_file() from the new grep.c. Also changed declaration in internal.h and replaced instances of cstring_lineFromFile() in dc.c and sort.c with get_line_from_file(). Tested them and they worked fine.
2000-06-28Brand, spankin', new grep that uses libc regex routines instead of theMark Whitley
hand-rolled ones. Sed still needs to be replaced and then the regexp stuff can be axed.
2000-06-19Updates to a number of apps to remove warnings/compile errors under libc5.Eric Andersen
Tested under both libc5 and libc6 and all seems well with these fixes. -Erik
2000-06-16Fix some spelling errors in the source as well.Eric Andersen
-Erik
2000-06-14+ removed some cruft left over from when lines could be too long.John Beppu
2000-06-13Fix a bug pointed out by Michal Jaegermann <michal@ellpspace.math.ualberta.ca>Eric Andersen
where you used to see: ./grep -q -i B some_file B: No such file or directory This is now fixed. -Erik