summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Net/Netrc.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-04-26 22:16:26 +0000
committerKarl Berry <karl@freefriends.org>2015-04-26 22:16:26 +0000
commit342e672574c4e67d510e46ab6acd0e21a7d0cf54 (patch)
tree79e04202d08c0404bbd780bd26c1e34710e539b6 /Master/tlpkg/tlperl/lib/Net/Netrc.pm
parentbe2706af7c57a0ef0f4d4e9f684ca4ef74922a82 (diff)
(tl)perl 5.20.2 for windows, from siep
git-svn-id: svn://tug.org/texlive/trunk@37064 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Net/Netrc.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Net/Netrc.pm20
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