If the search pattern ends with a newline then -w misbehaves:
% mkdir n; cd n
% echo abcde >foo
% ack -w bcd
% ack -w 'bcd|
'
foo
1:abcde
Here the last command typed contains a newline between '' characters.
(While I agree that a newline in a pattern is an unusual case, it is not impossible, and a correct program is one that works on all inputs, not just the more likely ones. If newline in patterns is not supported then it would be better to give a warning.)
If the search pattern ends with a newline then -w misbehaves:
Here the last command typed contains a newline between '' characters.
(While I agree that a newline in a pattern is an unusual case, it is not impossible, and a correct program is one that works on all inputs, not just the more likely ones. If newline in patterns is not supported then it would be better to give a warning.)