ack3 icon indicating copy to clipboard operation
ack3 copied to clipboard

ack should not hang on finding a file named "-"

Open petdance opened this issue 7 years ago • 3 comments
trafficstars

If I specify $ ack foo - then ack should search standard input.

If it finds a file called - in the root of the tree, it shouldn't hang waiting for input from standard input.

This doesn't behave like this in ack2.

petdance avatar Aug 14 '18 15:08 petdance

That's a weird one. But yes, the special handling for - should be for literally - in @ARGV not for - being returned by our recursive iterator ...

but if --verbose is on, we might want to throw a warning for any filename recursively found consisting of only punctuation and whitespace, or containing key special characters like ; or & !

n1vux avatar Aug 15 '18 04:08 n1vux

See also #269.

petdance avatar Feb 05 '20 03:02 petdance

This issue is actually worse than hinted above - having a file called - in the root of the tree causes ack to hang always, regardless of what arguments you give it

$ touch ./-
$ time ack Somethingorother
# (hangs forever)

craigds avatar Jul 15 '21 22:07 craigds