From: Rafael Garcia-Suarez Date: Tue, 3 May 2005 08:53:25 +0000 (+0000) Subject: Fix for [perl #34252] Access rights in FindBin::Bin X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d161605f8e10199e4c300f0a0e3d3c71656ee35;p=p5sagit%2Fp5-mst-13.2.git Fix for [perl #34252] Access rights in FindBin::Bin At least on my platform, Cwd::getcwd doesn't find the current directory if it has no access to it. Try harder with Cwd::cwd. p4raw-id: //depot/perl@24375 --- diff --git a/lib/FindBin.pm b/lib/FindBin.pm index 4610beb..122f083 100644 --- a/lib/FindBin.pm +++ b/lib/FindBin.pm @@ -93,7 +93,7 @@ package FindBin; use Carp; require 5.000; require Exporter; -use Cwd qw(getcwd abs_path); +use Cwd qw(getcwd cwd abs_path); use Config; use File::Basename; use File::Spec; @@ -102,7 +102,7 @@ use File::Spec; %EXPORT_TAGS = (ALL => [qw($Bin $Script $RealBin $RealScript $Dir $RealDir)]); @ISA = qw(Exporter); -$VERSION = "1.44"; +$VERSION = "1.45"; sub init { @@ -158,8 +158,10 @@ sub init croak("Cannot find current script '$0'") unless(-f $script); - # Ensure $script contains the complete path incase we C + # Ensure $script contains the complete path in case we C + my $cwd = getcwd(); + defined $cwd or $cwd = cwd(); # try harder $script = File::Spec->catfile(getcwd(), $script) unless File::Spec->file_name_is_absolute($script);