aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
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));