about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2001-09-21 01:52:25 +0000
committerGraham Barr <gbarr@pobox.com>2001-09-21 01:52:25 +0000
commit138f2152fa6e43746c2328f3f0c615c94e9e56dd (patch)
tree319b7644297d12e8825e37f244cc13281cbb8d9e
parentf70f615be8703dac7093f7ec28beeda54980d0f9 (diff)
downloadperl-libnet-138f2152fa6e43746c2328f3f0c615c94e9e56dd.tar.gz
Net::Config, Net::Netrc
- Handle $home on w2k

-rw-r--r--Net/Config.pm5
-rw-r--r--Net/Netrc.pm5
2 files changed, 6 insertions, 4 deletions
diff --git a/Net/Config.pm b/Net/Config.pm
index db503b5..788aca5 100644
--- a/Net/Config.pm
+++ b/Net/Config.pm
@@ -13,7 +13,7 @@ use strict;
 
 @EXPORT  = qw(%NetConfig);
 @ISA     = qw(Net::LocalCfg Exporter);
-$VERSION = "1.05"; # $Id: //depot/libnet/Net/Config.pm#9 $
+$VERSION = "1.06"; # $Id: //depot/libnet/Net/Config.pm#10 $
 
 eval { local $SIG{__DIE__}; require Net::LocalCfg };
 
@@ -45,6 +45,7 @@ if ( -f $file ) {
 }
 if ($< == $> and !$CONFIGURE)  {
     my $home = eval { (getpwuid($>))[7] } || $ENV{HOME};
+    $home ||= $ENV{HOMEDRIVE} . ($ENV{HOMEPATH}||'') if defined $ENV{HOMEDRIVE};
     if (defined $home) {
         $file = $home . "/.libnetrc";
         $ref = eval { do $file } if -f $file;
@@ -284,6 +285,6 @@ If true the C<Configure> will check each hostname given that it exists
 
 =for html <hr>
 
-I<$Id: //depot/libnet/Net/Config.pm#9 $>
+I<$Id: //depot/libnet/Net/Config.pm#10 $>
 
 =cut
diff --git a/Net/Netrc.pm b/Net/Netrc.pm
index bbd62ab..bbb3f23 100644
--- a/Net/Netrc.pm
+++ b/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#11 $
 
 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";
  }
 
@@ -328,6 +329,6 @@ it under the same terms as Perl itself.
 
 =for html <hr>
 
-$Id: //depot/libnet/Net/Netrc.pm#10 $
+$Id: //depot/libnet/Net/Netrc.pm#11 $
 
 =cut