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

Emits a perl warning about uninitialized value when run from a removed directory #634

Closed xtaran closed 7 years ago

xtaran commented 7 years ago

Originally reported in Debian against ack 2.15_01, but I can also reproduce this with ack 2.14 as well as ack 2.15_03:

This program emits a perl warning when it is run from a directory that has been removed. To demonstrate:

$ mkdir /tmp/aaa
$ cd /tmp/aaa
$ rmdir /tmp/aaa
$ ack foo
Use of uninitialized value $cwd in pattern match (m//) at /usr/share/perl5/App/Ack/ConfigFinder.pm line 122.
petdance commented 7 years ago

Interesting. Thanks for reporting.

petdance commented 7 years ago

Apparently this can return undef.

my $cwd = Cwd::getcwd();
petdance commented 7 years ago

Fixed. Will be released in 2.17_02.