aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Added support for reading from stdin with '-' as file name arg.markw2000-06-281-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@723 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Yanked out the cstring_alloc() and cstring_lineFromFile() functions frommarkw2000-06-281-31/+0
| | | | | | | | | | 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. git-svn-id: svn://busybox.net/trunk/busybox@722 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Brand, spankin', new grep that uses libc regex routines instead of themarkw2000-06-281-100/+155
| | | | | | | | hand-rolled ones. Sed still needs to be replaced and then the regexp stuff can be axed. git-svn-id: svn://busybox.net/trunk/busybox@721 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Updates to a number of apps to remove warnings/compile errors under libc5.andersen2000-06-191-1/+1
| | | | | | | | Tested under both libc5 and libc6 and all seems well with these fixes. -Erik git-svn-id: svn://busybox.net/trunk/busybox@660 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix some spelling errors in the source as well.andersen2000-06-161-2/+2
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@655 69ca8d6d-28ef-0310-b511-8ec308f3f277
* + removed some cruft left over from when lines could be too long.beppu2000-06-141-3/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@644 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix a bug pointed out by Michal Jaegermann <michal@ellpspace.math.ualberta.ca>andersen2000-06-131-9/+13
| | | | | | | | | | | where you used to see: ./grep -q -i B some_file B: No such file or directory This is now fixed. -Erik git-svn-id: svn://busybox.net/trunk/busybox@639 69ca8d6d-28ef-0310-b511-8ec308f3f277
* + utility.cbeppu2000-06-121-5/+3
| | | | | | | | | | CSTRING_BUFFER_LENGTH = 1024 /* so it recurses less often */ + grep.c uses cstring_lineFromFile(), and doesn't ever say Line is too long, anymore git-svn-id: svn://busybox.net/trunk/busybox@637 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Lots of updates. Finished implementing BB_FEATURE_TRIVIAL_HELPerik2000-05-121-3/+6
| | | | | | | | | | | which lets you compile out most of the "--help" output, saving up to 17k. Renamed mnc to nc. -Erik git-svn-id: svn://busybox.net/trunk/busybox@532 69ca8d6d-28ef-0310-b511-8ec308f3f277
* + grep -v # yay!beppu2000-04-241-12/+15
| | | | git-svn-id: svn://busybox.net/trunk/busybox@494 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Upates to include copyright 2000 to everythingerik2000-04-131-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@447 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Some formatting updates (ran the code through indent)erik2000-02-081-91/+91
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@357 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Bug fix. grep wasn't printing file names they way it was supposed to.erik2000-01-191-3/+6
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@316 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed cp so it works as God intended it to.erik1999-12-291-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@267 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added grep -q, thanks to a patch from "Konstantin Boldyshev" <konst@voshod.com>erik1999-12-211-3/+20
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@254 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Updates to usage, and made tar work.andersen1999-11-101-3/+4
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@94 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Stuffandersen1999-11-091-41/+38
| | | | git-svn-id: svn://busybox.net/trunk/busybox@87 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Stuffandersen1999-11-081-23/+36
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@86 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Stufandersen1999-10-281-3/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@64 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added regexp support, fixed Changelog.andersen1999-10-221-36/+10
| | | | git-svn-id: svn://busybox.net/trunk/busybox@50 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed up copyright notices and suchandersen1999-10-201-1/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@49 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added sfdisk. Ststic-ified a bunch of stuff.andersen1999-10-191-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@38 69ca8d6d-28ef-0310-b511-8ec308f3f277
* fixes grep, added loadfont from debian bootfloppies.andersen1999-10-191-95/+58
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@36 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More stuff...andersen1999-10-121-73/+71
| | | | git-svn-id: svn://busybox.net/trunk/busybox@19 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More stuff.andersen1999-10-091-5/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@17 69ca8d6d-28ef-0310-b511-8ec308f3f277
* more stuffandersen1999-10-071-132/+119
| | | | git-svn-id: svn://busybox.net/trunk/busybox@15 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More stuff.andersen1999-10-061-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@13 69ca8d6d-28ef-0310-b511-8ec308f3f277