aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /findutils/grep.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
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.)
Diffstat (limited to 'findutils/grep.c')
-rw-r--r--findutils/grep.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index ecb1d0457..b53bf490a 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -17,11 +17,6 @@
17*/ 17*/
18 18
19#include "busybox.h" 19#include "busybox.h"
20#include <stdio.h>
21#include <stdlib.h>
22#include <getopt.h>
23#include <string.h>
24#include <errno.h>
25#include "xregex.h" 20#include "xregex.h"
26 21
27 22
@@ -203,7 +198,7 @@ static int grep_file(FILE *file)
203 /* Add the line to the circular 'before' buffer */ 198 /* Add the line to the circular 'before' buffer */
204 if(lines_before) { 199 if(lines_before) {
205 free(before_buf[curpos]); 200 free(before_buf[curpos]);
206 before_buf[curpos] = bb_xstrdup(line); 201 before_buf[curpos] = xstrdup(line);
207 curpos = (curpos + 1) % lines_before; 202 curpos = (curpos + 1) % lines_before;
208 } 203 }
209 } 204 }
@@ -271,7 +266,7 @@ static void load_regexes_from_file(llist_t *fopt)
271 266
272 fopt = cur->link; 267 fopt = cur->link;
273 free(cur); 268 free(cur);
274 f = bb_xfopen(ffile, "r"); 269 f = xfopen(ffile, "r");
275 while ((line = bb_get_chomped_line_from_file(f)) != NULL) { 270 while ((line = bb_get_chomped_line_from_file(f)) != NULL) {
276 llist_add_to(&pattern_head, 271 llist_add_to(&pattern_head,
277 new_grep_list_data(line, PATTERN_MEM_A)); 272 new_grep_list_data(line, PATTERN_MEM_A));