aboutsummaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-26 09:46:41 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-26 09:46:41 +0000
commit7f164cd05226615e9518e74eceb0b47c15cbe3e6 (patch)
tree4790f4a882e957df6c40d887ba2fd0ab8c519c47 /findutils
parentf086ed8ddd4bed67cb255c56b835ea24065c5c5f (diff)
downloadbusybox-7f164cd05226615e9518e74eceb0b47c15cbe3e6.tar.gz
Patch from vodz to correct 'grep -e pattern1 -e pattern2' logic
Diffstat (limited to 'findutils')
-rw-r--r--findutils/grep.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 3ba746373..6ece0ab12 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -20,8 +20,8 @@
*
*/
/*
- * Jun 2003 by Vladimir Oleynik <dzo@simtreas.ru> -
- * correction "-e pattern1 -e -e pattern2" logic and more optimizations.
+ * Apr 2004 by Vladimir Oleynik <dzo@simtreas.ru> -
+ * correction "-e pattern1 -e pattern2" logic and more optimizations.
*/
#include <stdio.h>
@@ -135,11 +135,9 @@ static int grep_file(FILE *file)
*/
regex_t regex;
xregcomp(&regex, pattern_ptr->data, reflags);
- ret = regexec(&regex, line, 0, NULL, 0) == 0;
+ ret |= regexec(&regex, line, 0, NULL, 0) == 0;
regfree(&regex);
}
- if (!ret)
- break;
pattern_ptr = pattern_ptr->link;
} /* while (pattern_ptr) */