petdance/ack2 — pull request #396 by bartlomiejb (2013-10-10 17:05:59+00:00)
Title: Fix issue #326 ("flags --column and --context together produce an error")

Test included.

Discussion: currently using options --column and -C together results in warnings and adding column position even when there is no match in line (for preceding context). For example:

```
$ ./tack --column -C 2 'Freedom of choice!' t/text/
t/text/freedom-of-choice.txt
19-1-Freedom of choice
20-1-Is what you got
21:1:Freedom of choice!
Use of uninitialized value $line_parts[1] in join or string at blib/script/ack line 569, <__ANONIO__> line 21.
22--
Use of uninitialized value $line_parts[1] in join or string at blib/script/ack line 569, <__ANONIO__> line 21.
23--Then if you've got it, you don't want it
--
32-1-Freedom of choice
33-1-Is what you got
34:1:Freedom of choice!
Use of uninitialized value $line_parts[1] in join or string at blib/script/ack line 569, <__ANONIO__> line 34.
35--
Use of uninitialized value $line_parts[1] in join or string at blib/script/ack line 569, <__ANONIO__> line 34.
36--In ancient Rome
```

This patch fixes this. After applying this patch the result is:
```
$ ./tack --column -C 2 'Freedom of choice!' t/text/
t/text/freedom-of-choice.txt
19-Freedom of choice
20-Is what you got
21:1:Freedom of choice!
22-
23-Then if you've got it, you don't want it
--
32-Freedom of choice
33-Is what you got
34:1:Freedom of choice!
35-
36-In ancient Rome
```