Subject: | Missing undef check in File::Spec::Unix::canonpath |
With warnings turned on, File::Spec::Unix::canonpath() spews many warnings when passed an undef path. The following patch causes this method to simply return undef instead of trying to perform regexes on the undef value.
--- Unix.pm.orig 2003-10-16 10:08:56.000000000 -0500
+++ Unix.pm 2003-10-16 10:10:05.000000000 -0500
@@ -35,6 +35,8 @@
sub canonpath {
my ($self,$path) = @_;
+ return undef unless (defined $path);
+
# Handle POSIX-style node names beginning with double slash (qnx, nto)
# Handle network path names beginning with double slash (cygwin)
# (POSIX says: "a pathname that begins with two successive slashes