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

ack hangs on an unfinished "|" #627

Closed jalanb closed 7 years ago

jalanb commented 7 years ago

Context: searching python code for .split('|'), so I used ack like

$ /usr/local/bin/ack --python 'split..|'

This resulted in ack showing me the name of the first matching file and then hanging. Quickly realised the silly mistake and retried with the | escaped

$ /usr/local/bin/ack --python 'split..\|'

which worked fine. So not really an issue for me, just thought you'd like to know.

For completeness, I tried the following, which found nothing (because I don't have any perl files in that dir), and came back without hanging.

$ /usr/local/bin/ack --perl 'split..|'

Adding a single .pl file, even an empty one, will then cause that command to hang

hoelzro commented 7 years ago

I'm guessing that the RHS of the | is matching the empty string, so the matching engine doesn't advance. This looks to be happening with .? as well.

hoelzro commented 7 years ago

This appears to have been fixed in 80402b4cca94834795210fc6e25261f2d57eb049

petdance commented 7 years ago

This went out in 2.16.

jalanb commented 7 years ago

Works for me at verson 2.16, thanks