summaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorDenys Vlasenko2018-03-29 18:03:50 +0200
committerDenys Vlasenko2018-03-29 18:03:50 +0200
commit03fd7e06f854d385070a6fc9714f445727c359cd (patch)
tree4e1b3874319a795ce7adb296b97891b7d549188e /findutils/grep.c
parent3be4b9b0dee790bc19314411f109d6dcb14f97dc (diff)
downloadbusybox-03fd7e06f854d385070a6fc9714f445727c359cd.zip
busybox-03fd7e06f854d385070a6fc9714f445727c359cd.tar.gz
grep: fix echo "aa" | busybox grep -F -w "a" (should not match)
function old new delta grep_file 1461 1470 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'findutils/grep.c')
-rw-r--r--findutils/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index fc6de4b..88de0d4 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -352,7 +352,7 @@ static int grep_file(FILE *file)
goto opt_f_not_found;
} else
if (option_mask32 & OPT_w) {
- char c = (match != str) ? match[-1] : ' ';
+ char c = (match != line) ? match[-1] : ' ';
if (!isalnum(c) && c != '_') {
c = match[strlen(gl->pattern)];
if (!c || (!isalnum(c) && c != '_'))