aboutsummaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-10-08 08:10:57 +0000
committerEric Andersen <andersen@codepoet.org>2004-10-08 08:10:57 +0000
commit31c27a9c6559b46c5e20fd64eaa8019daaba5e5c (patch)
treebbcee4a58f93aa67a5abc4a10d872dc0fa1de629 /findutils
parent94d628c76ab8e1a7837f4fda5a21be531f8efdea (diff)
downloadbusybox-31c27a9c6559b46c5e20fd64eaa8019daaba5e5c.tar.gz
Hiroshi Ito writes:
Hello I'm using busy box on mipsel machine. "grep -f file" will cause segmentation fault. Vladimir N. Oleynik writes: Hiroshi, Thank for bug report, but your patch is full broken. Worked patch attached. (really changes is zero initialize, and indent correcting). --w vodz
Diffstat (limited to 'findutils')
-rw-r--r--findutils/grep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index ddc5cea9c..29f4ecd4f 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -249,9 +249,9 @@ static void load_regexes_from_file(llist_t *fopt)
fopt = cur->link;
free(cur);
f = bb_xfopen(ffile, "r");
- while ((line = bb_get_chomped_line_from_file(f)) != NULL) {
- pattern_head = llist_add_to(pattern_head, line);
- }
+ while ((line = bb_get_chomped_line_from_file(f)) != NULL) {
+ pattern_head = llist_add_to(pattern_head, line);
+ }
}
}
@@ -261,7 +261,7 @@ extern int grep_main(int argc, char **argv)
FILE *file;
int matched;
unsigned long opt;
- llist_t *fopt;
+ llist_t *fopt = NULL;
/* do normal option parsing */
#ifdef CONFIG_FEATURE_GREP_CONTEXT