diff options
author | Ari Sundholm | 2019-01-29 14:42:57 +0100 |
---|---|---|
committer | Denys Vlasenko | 2019-02-14 14:40:57 +0100 |
commit | 256ee622249830d102c58edccf893104a4a34037 (patch) | |
tree | ab1bcfbec588cd3e7fcc3f4696c9e6a7cfb5419b /docs | |
parent | 5c6b9165e776f60b7bfeb01a2d5fa6331ee0cb89 (diff) | |
download | busybox-256ee622249830d102c58edccf893104a4a34037.zip busybox-256ee622249830d102c58edccf893104a4a34037.tar.gz |
grep: fix -x -v with certain pattern orders
We found out that busybox -x -v is a bit broken:
ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -e 'aa.*' -e '.*bb.*'
aa bb cc
ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -v -e 'aa.*' -e '.*bb.*'
ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -e '.*aa.*' -e 'bb.*'
aa bb cc
ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -v -e '.*aa.*' -e 'bb.*'
aa bb cc
Last one is wrong.
This patch fixes the issue by making sure that the variable 'found'
never makes a transition from 1 to 0, as this would mean that
grep previously found a match on this input line.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Signed-off-by: Niko Vähäsarja <niko@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions