X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FNet%2FNetrc.pm;h=a44b6e319ea485417bab7fdd5f2327144de03109;hb=302c2e6b3178d72ea1114a76af5852e6680bacc8;hp=bbd62ab5f2f8d94a1960b170f02c15d6633d5497;hpb=686337f3173d259f9dc05f9d6c19a8c95e2cb00b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Net/Netrc.pm b/lib/Net/Netrc.pm index bbd62ab..a44b6e3 100644 --- a/lib/Net/Netrc.pm +++ b/lib/Net/Netrc.pm @@ -11,7 +11,7 @@ use strict; use FileHandle; use vars qw($VERSION); -$VERSION = "2.11"; # $Id: //depot/libnet/Net/Netrc.pm#10 $ +$VERSION = "2.12"; # $Id: //depot/libnet/Net/Netrc.pm#12 $ my %netrc = (); @@ -27,6 +27,7 @@ sub _readrc } else { # 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"; } @@ -287,6 +288,9 @@ the first entry in the .netrc file for C will be returned. If a matching entry cannot be found, and a default entry exists, then a reference to the default entry is returned. +If there is no matching entry found and there is no default defined, or +no .netrc file is found, then C is returned. + =back =head1 METHODS @@ -328,6 +332,6 @@ it under the same terms as Perl itself. =for html
-$Id: //depot/libnet/Net/Netrc.pm#10 $ +$Id: //depot/libnet/Net/Netrc.pm#12 $ =cut