beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

2.14 hang with zero-length match (using look-ahead) #547

Closed powerman closed 9 years ago

powerman commented 9 years ago
~ $ mkdir tmp/ack
~ $ cd tmp/ack/
~/tmp/ack $ echo 'say "This is a test";' > test.pl
~/tmp/ack $ ack test 
test.pl
1:say "This is a test";
~/tmp/ack $ ack '(?=test)'
test.pl
----- HERE IT HANGS! Press Ctrl-C -----
^C
~/tmp/ack $ ack '(?=test).*'
test.pl
1:say "This is a test";

The real use-case was when I was looking for combination of several words which should be in same line but in unknown order, like:

ack '(?=.*word1)(?=.*word2)'
hoelzro commented 9 years ago

Thanks for the report! This issue has already been reported as #542, and has been fixed in the dev branch.