aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
commit5e2a5391f9142bca773aab4c829615895b69a6b7 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /findutils/grep.c
parente883e03918a0e26e390ea23996abdb8fc1925f88 (diff)
downloadbusybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.gz
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.bz2
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.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.) git-svn-id: svn://busybox.net/trunk/busybox@15767 69ca8d6d-28ef-0310-b511-8ec308f3f277
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));