aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* grep -f support, adds only 60 Bytes, but regex's now compiled asbug12003-04-271-27/+48
| | | | | | | required, rather than being pre-compiled. git-svn-id: svn://busybox.net/trunk/busybox@6818 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Major coreutils update.mjn32003-03-191-13/+11
| | | | git-svn-id: svn://busybox.net/trunk/busybox@6751 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Change if(x)free(x); to free(x);aaronl2002-11-281-4/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@6055 69ca8d6d-28ef-0310-b511-8ec308f3f277
* * findutils/grep.c (grep_main): Remove unnecessary use of junk.kraai2002-02-221-3/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@4260 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix undeclared variable error.kraai2001-11-201-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3759 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Usr get_last_path_component() name basename()andersen2001-11-201-1/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3737 69ca8d6d-28ef-0310-b511-8ec308f3f277
* oopsandersen2001-11-191-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3714 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More scrubbingandersen2001-11-191-4/+4
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3713 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixup CLEANUP behaviorandersen2001-11-191-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3709 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Convert strdup call to xstrdup, and calloc calls to xcalloc (patch fromkraai2001-11-121-3/+3
| | | | | | | Steve Merrifield). git-svn-id: svn://busybox.net/trunk/busybox@3667 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add in grep -E supportandersen2001-11-101-0/+8
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3653 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Make egrep only set REG_EXTENDED flag.kraai2001-10-311-1/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3621 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Charles Steinkuehler <charles@steinkuehler.net>andersen2001-10-311-0/+1
| | | | | | | to properly handle extended regexps for egrep git-svn-id: svn://busybox.net/trunk/busybox@3608 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use extended regular expressions when invoked as egrep (noted and initialkraai2001-10-291-0/+5
| | | | | | | patch by Charles Steinkuehler). git-svn-id: svn://busybox.net/trunk/busybox@3601 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Major rework of the directory structure and the entire build system.andersen2001-10-241-18/+18
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@3561 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Scrub up some function prototypes.andersen2001-10-181-1/+0
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@3540 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix behavior of grep -lc to match GNU grep. SuS2 is ambiguousandersen2001-07-311-1/+4
| | | | | | | | on the correct behavior, so acting like GNU grep seems best -Erik git-svn-id: svn://busybox.net/trunk/busybox@3176 69ca8d6d-28ef-0310-b511-8ec308f3f277
* grep failed to compile when BB_FEATURE_CLEAN_UP was defined -- types were wrong.andersen2001-05-291-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2762 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added support for grep -e and grep -f, closes bug #1164. Also added somemarkw2001-05-241-95/+142
| | | | | | | testcases for these new features. git-svn-id: svn://busybox.net/trunk/busybox@2722 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed extra -- lines (noted by Christophe Boyanique).kraai2001-05-221-1/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2699 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed mishandling of -c & -l options and accounted for case when we'remarkw2001-05-211-7/+16
| | | | | | | grepping only one file. git-svn-id: svn://busybox.net/trunk/busybox@2692 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.ckraai2001-05-161-1/+1
| | | | | | | by Larry Doolittle. git-svn-id: svn://busybox.net/trunk/busybox@2653 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed a subtle bug in the handling of -l and -c flags.markw2001-05-141-19/+19
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2637 69ca8d6d-28ef-0310-b511-8ec308f3f277
* The tiniest of bracket-placement fixes.markw2001-04-171-5/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2358 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Make 'grep -l' workandersen2001-04-091-5/+16
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2290 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed option parsing. Grep would continue grepping, even when given a bad /markw2001-04-091-0/+2
| | | | | | | invalid option. Closes bug #1146. git-svn-id: svn://busybox.net/trunk/busybox@2289 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This patch, put together by Manuel Novoa III, is a merge of workandersen2001-02-141-1/+1
| | | | | | | | | done by Evin Robertson (bug#1105) and work from Manuel to make usage messages occupy less space and simplify how usage messages are displayed. git-svn-id: svn://busybox.net/trunk/busybox@1805 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Implemented -A, -B, and -C flags with BB_FEATURE_GREP_CONTEXT option set.markw2001-02-091-14/+125
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1762 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Tightened things up a bit, saved 20 bytes, and made the code a bit clearer inmarkw2001-02-011-29/+14
| | | | | | | the process. git-svn-id: svn://busybox.net/trunk/busybox@1738 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix wget error message and add (and use) chomp library function.kraai2001-02-011-2/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1734 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix up copyright msgs. Bump version to 0.49 in preparation forandersen2001-01-271-1/+1
| | | | | | | | a release. Update the website with release details. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1697 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix header file usage -- there were many unnecessary header files included inandersen2001-01-271-0/+2
| | | | | | | | | | 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 git-svn-id: svn://busybox.net/trunk/busybox@1695 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Changed email address to codepoet.org, updated list of applets / docs Imarkw2001-01-041-1/+1
| | | | | | | maintain in AUTHORS. git-svn-id: svn://busybox.net/trunk/busybox@1537 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed -qv interaction (thanks to a report and patch from David Douthitt).kraai2001-01-041-0/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1534 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Change calls to error_msg.* and strerror to use perror_msg.*.kraai2000-12-181-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1466 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Changed names of functions in utility.c and all affected files, to makemarkw2000-12-071-1/+1
| | | | | | | compliant with the style guide. Everybody rebuild your tags file! git-svn-id: svn://busybox.net/trunk/busybox@1398 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix handling of ^$ by removing the newline from input lines and by notkraai2000-10-131-2/+4
| | | | | | | compiling with REG_NEWLINE. git-svn-id: svn://busybox.net/trunk/busybox@1190 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Renamed "internal.h" to the more sensible "busybox.h".andersen2000-09-251-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@1119 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Exit with the appropriate value when grepping multiple files.kraai2000-08-061-4/+6
| | | | git-svn-id: svn://busybox.net/trunk/busybox@943 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Centralize handling of --help.kraai2000-07-191-4/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@883 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Consolodated some common code into print_matched_line to make 'grep_file' amarkw2000-07-181-10/+11
| | | | | | | little more terse & clean. Also made a few minor formatting changes. git-svn-id: svn://busybox.net/trunk/busybox@875 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added support for the -c (count matches) option. Made it so it works just likemarkw2000-07-181-3/+22
| | | | | | | GNU grep. git-svn-id: svn://busybox.net/trunk/busybox@873 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Extract usage information into a separate file.kraai2000-07-161-15/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@864 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use errorMsg rather than fprintf.kraai2000-07-141-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@848 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Changed bb_regcomp to xregcomp and #if 0'ed out destroy_cmd_strs in sed.cmarkw2000-07-121-2/+1
| | | | | | | (maybe I'll remove it later). git-svn-id: svn://busybox.net/trunk/busybox@833 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Matt Kraai which does the following:markw2000-07-111-14/+1
| | | | | | | | | | - 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 git-svn-id: svn://busybox.net/trunk/busybox@812 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Matt Kraai as per his email:markw2000-07-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn://busybox.net/trunk/busybox@796 69ca8d6d-28ef-0310-b511-8ec308f3f277
* include getopt.handersen2000-07-091-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@793 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Some cosmetic updates. Changed "OPTIONS" to "Options".andersen2000-07-041-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@735 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed comment.markw2000-06-281-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@724 69ca8d6d-28ef-0310-b511-8ec308f3f277