diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Net/Netrc.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Net/Netrc.pm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Master/tlpkg/tlperl/lib/Net/Netrc.pm b/Master/tlpkg/tlperl/lib/Net/Netrc.pm index 28c826b38cd..fbe8d6d5be4 100644 --- a/Master/tlpkg/tlperl/lib/Net/Netrc.pm +++ b/Master/tlpkg/tlperl/lib/Net/Netrc.pm @@ -9,9 +9,9 @@ package Net::Netrc; use Carp; use strict; use FileHandle; -use vars qw($VERSION); +use vars qw($VERSION $TESTING); -$VERSION = "2.12"; +$VERSION = "2.14"; my %netrc = (); @@ -27,10 +27,18 @@ sub _readrc { } else { - # Some OS's don't have `getpwuid', so we default to $ENV{HOME} + # Some OS's don't have "getpwuid", so we default to $ENV{HOME} $home = eval { (getpwuid($>))[7] } || $ENV{HOME}; $home ||= $ENV{HOMEDRIVE} . ($ENV{HOMEPATH} || '') if defined $ENV{HOMEDRIVE}; - $file = $home . "/.netrc"; + if (-e $home . "/.netrc") { + $file = $home . "/.netrc"; + } + elsif (-e $home . "/_netrc") { + $file = $home . "/_netrc"; + } + else { + return unless $TESTING; + } } my ($login, $pass, $acct) = (undef, undef, undef); @@ -39,7 +47,7 @@ sub _readrc { $netrc{default} = undef; - # OS/2 and Win32 do not handle stat in a way compatable with this check :-( + # OS/2 and Win32 do not handle stat in a way compatible with this check :-( unless ($^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'MacOS' @@ -303,7 +311,7 @@ Return the account information for the netrc entry =item lpa () -Return a list of login, password and account information fir the netrc entry +Return a list of login, password and account information for the netrc entry =back |