CC: | Mark Grimes <mgrimes [...] cpan.org> |
Subject: | [PATCH] Bug fix for walking parent dirs searching for 'lib' |
Date: | Mon, 15 Jun 2009 21:11:43 -0700 |
To: | bug-Devel-IntelliPerl [...] rt.cpan.org |
From: | mgrimes [...] cpan.org |
From: Mark Grimes <mgrimes@cpan.org>
On my system (linux, perl 5.10, Path::Class 0.16) the update_inc
method will continue to tack "../" onto the files directory
forever. This patch checks to see $parent exists otherwise it ends.
---
lib/Devel/IntelliPerl.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/Devel/IntelliPerl.pm b/lib/Devel/IntelliPerl.pm
index 966ef8e..fe50182 100644
--- a/lib/Devel/IntelliPerl.pm
+++ b/lib/Devel/IntelliPerl.pm
@@ -39,6 +39,7 @@ sub update_inc {
my @libs;
while ( $parent = $parent->parent ) {
last if ( $parent eq $parent->parent );
+ last unless -d $parent;
push( @libs, $parent->subdir('lib')->stringify )
if ( -e $parent->subdir('lib') );
}
--
1.6.3.2