grep: fix -o match with empty string (suggested by Colin Watson <cjwatson@ubuntu.com>)

function                                             old     new   delta
grep_file                                           1216    1251     +35

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-08-23 02:39:47 +02:00
parent b276e41835
commit 3d8b96d58d
2 changed files with 11 additions and 3 deletions

View File

@ -98,5 +98,9 @@ testing "grep -o does not loop forever" \
'grep -o "[^/]*$"' \
"test\n" \
"" "/var/test\n"
testing "grep -o does not loop forever on zero-length match" \
'grep -o "" | head -n1' \
"" \
"" "test\n"
exit $FAILCOUNT