Commit Graph

85 Commits

Author SHA1 Message Date
Mark Whitley
2fd52989f7 Implemented -A, -B, and -C flags with BB_FEATURE_GREP_CONTEXT option set. 2001-02-09 00:41:10 +00:00
Matt Kraai
096370d349 Reworked find with David Douthitt to support -type, -perm, -mtime, and
other improvements.
2001-02-07 03:52:38 +00:00
Mark Whitley
b5c29850e3 Tightened things up a bit, saved 20 bytes, and made the code a bit clearer in
the process.
2001-02-01 21:02:41 +00:00
Matt Kraai
05e782ddd3 Fix wget error message and add (and use) chomp library function. 2001-02-01 16:49:30 +00:00
Eric Andersen
8ec10a9483 Fix up copyright msgs. Bump version to 0.49 in preparation for
a release.  Update the website with release details.
 -Erik
2001-01-27 09:33:39 +00:00
Eric Andersen
ed3ef50c23 Fix header file usage -- there were many unnecessary header files included in
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-27 08:24:39 +00:00
Matt Kraai
12f417edbd Eliminate calls of the form "fprintf(stdout,". Thanks for the idea to
Vladimir N. Oleynik.
2001-01-18 02:57:08 +00:00
Mark Whitley
6c6ea6cba2 Changed email address to codepoet.org, updated list of applets / docs I
maintain in AUTHORS.
2001-01-04 22:21:13 +00:00
Matt Kraai
0810f723b1 Fixed -qv interaction (thanks to a report and patch from David Douthitt). 2001-01-04 15:11:52 +00:00
Matt Kraai
a9819b2908 Use busybox error handling functions wherever possible. 2000-12-22 01:48:07 +00:00
Matt Kraai
1fa1adea2a Change calls to error_msg.* and strerror to use perror_msg.*. 2000-12-18 03:57:16 +00:00
Mark Whitley
f57c944e09 Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
2000-12-07 19:56:48 +00:00
Matt Kraai
3e856ce428 Stop using TRUE and FALSE for exit status. 2000-12-01 02:55:13 +00:00
Matt Kraai
768a2340b5 Fixed return status (thanks to David Douthitt for the fix). 2000-11-18 01:16:43 +00:00
Mark Whitley
e2e2c29ea1 Brand new version of xargs. Tested thoroughly by Kent Robotti. (Domo arigato,
Mr. Robotti...) Closes bug #1065.
2000-11-14 22:43:21 +00:00
Matt Kraai
567cdd1d51 Fix handling of ^$ by removing the newline from input lines and by not
compiling with REG_NEWLINE.
2000-10-13 18:55:06 +00:00
Eric Andersen
d266748c76 Yet more polish (thanks again to kent robotti for the bug reports).
-Erik
2000-09-26 01:00:15 +00:00
Eric Andersen
d89882da16 Some more polish to make xargs act like GNU xargs (thanks to kent robotti
<robotti@metconnect.com> for testing and pointing out the differences)
 -Erik
2000-09-25 22:53:05 +00:00
Eric Andersen
3570a34de4 Renamed "internal.h" to the more sensible "busybox.h".
-Erik
2000-09-25 21:45:58 +00:00
Eric Andersen
e081eae7a4 Final (I think) version of xargs. Throw away all that tedious string
scrubbing, and quit using system.  Instead, use fork() and exec(), which
yields and smaller, simpler, and cleaner design.
 -Erik
2000-09-25 20:23:21 +00:00
Eric Andersen
bf73909f23 Be ever so pedantic about escaping chars that the shell might not like... 2000-09-25 18:41:18 +00:00
Eric Andersen
6f283c2f77 Fix up xargs so that things like 'cat cat.c | xargs echo' will
work properly.
 -Erik
2000-09-24 02:40:56 +00:00
Eric Andersen
9ae3838657 Fix xargs option parsing 2000-09-24 01:12:54 +00:00
Eric Andersen
96bdde97fb Fix memory problems, and make behavior correct. 2000-09-23 19:53:31 +00:00
Eric Andersen
a37d5b772b rewrite, so it should be firly clean now 2000-09-23 06:10:14 +00:00
Eric Andersen
5b17693f0a Use minix xargs instead, and update docs accordingly
-Erik
2000-09-22 20:22:28 +00:00
Eric Andersen
ebc0dd7a8a Comment on xargs choice. 2000-09-22 20:02:34 +00:00
Eric Andersen
92a61c1206 Add in xargs 2000-09-22 20:01:23 +00:00
Glenn L McGrath
38c8551cf2 Path count was out by one, fixed it 2000-09-18 09:52:03 +00:00
Glenn L McGrath
63dde9d4ce Simplify and remove dependence on PATH_MAX
buf[PATH_MAX] now defined using strlen to the exact size to be used.
removed output that was displayed if which didnt find the command, this makes itmatch the behaviour of GNU's which.
These modifications result in a slight size decrease.
2000-09-18 09:37:40 +00:00
Matt Kraai
322ae93a5e Fix calls to {m,c,re}alloc so that they use x{m,c,re}alloc instead of
segfaulting or handling errors the same way themselves.
2000-09-13 02:46:14 +00:00
Eric Andersen
88f50b6bf5 Some #include updates.
-Erik
2000-08-10 17:59:11 +00:00
Matt Kraai
deb95f69b6 Exit with the appropriate value when grepping multiple files. 2000-08-06 15:25:53 +00:00
Matt Kraai
27a804246a Centralize handling of --help. 2000-07-19 19:24:01 +00:00
Mark Whitley
2ef880b236 Consolodated some common code into print_matched_line to make 'grep_file' a
little more terse & clean. Also made a few minor formatting changes.
2000-07-18 21:02:06 +00:00
Mark Whitley
8f122431f5 Added support for the -c (count matches) option. Made it so it works just like
GNU grep.
2000-07-18 18:37:01 +00:00
Matt Kraai
bf181b9338 Extract usage information into a separate file. 2000-07-16 20:57:15 +00:00
Matt Kraai
3bd8bd89ee Don't use strings directly in calls to usage(). This is in preparation
for their extraction to a separate file.
2000-07-14 23:28:47 +00:00
Matt Kraai
d537a95fdb Use errorMsg rather than fprintf. 2000-07-14 01:51:25 +00:00
Mark Whitley
c41e8c840f Changed bb_regcomp to xregcomp and #if 0'ed out destroy_cmd_strs in sed.c
(maybe I'll remove it later).
2000-07-12 23:35:21 +00:00
Mark Whitley
df5f6ba115 Applied patch from Matt Kraai which does the following:
- 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-11 16:53:56 +00:00
Mark Whitley
928faac503 Removed unnecessary #include "regexp.h" line from find.c as per Matt Kraai's
suggestion on the mailing list.
2000-07-10 19:29:09 +00:00
Mark Whitley
44735f8744 Applied patch from Matt Kraai as per his email:
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-10 15:50:26 +00:00
Eric Andersen
e9b527ae48 include getopt.h
-Erik
2000-07-09 05:56:14 +00:00
Eric Andersen
2086e3d679 Some cosmetic updates. Changed "OPTIONS" to "Options".
-Erik
2000-07-04 22:17:01 +00:00
Mark Whitley
2e1148b239 Fixed comment. 2000-06-28 22:59:30 +00:00
Mark Whitley
8bd891cbec Added support for reading from stdin with '-' as file name arg. 2000-06-28 22:55:59 +00:00
Mark Whitley
1ca41775bb Yanked out the cstring_alloc() and cstring_lineFromFile() functions from
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-28 22:15:26 +00:00
Mark Whitley
d37218941c Brand, spankin', new grep that uses libc regex routines instead of the
hand-rolled ones. Sed still needs to be replaced and then the regexp stuff can
be axed.
2000-06-28 22:00:26 +00:00
Eric Andersen
b610615be9 Updates to a number of apps to remove warnings/compile errors under libc5.
Tested under both libc5 and libc6 and all seems well with these fixes.
 -Erik
2000-06-19 17:25:40 +00:00