about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>1999-09-18 16:22:41 +0000
committerGraham Barr <gbarr@pobox.com>1999-09-18 16:22:41 +0000
commit030155b28fec83942599d7a9534556b8f0387f23 (patch)
tree535967e025edb2b2bdee100532243eb7da845bea
parent140741a7fc1fd5af21bb93b060fcfd277f663035 (diff)
downloadperl-libnet-030155b28fec83942599d7a9534556b8f0387f23.tar.gz
Net::Netrc
- Added support for spaces in passwords

-rw-r--r--Net/Netrc.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/Net/Netrc.pm b/Net/Netrc.pm
index b6fee1f..0c63310 100644
--- a/Net/Netrc.pm
+++ b/Net/Netrc.pm
@@ -11,7 +11,7 @@ use strict;
 use FileHandle;
 use vars qw($VERSION);
 
-$VERSION = "2.09"; # $Id: //depot/libnet/Net/Netrc.pm#4$
+$VERSION = "2.10"; # $Id: //depot/libnet/Net/Netrc.pm#4$
 
 my %netrc = ();
 
@@ -70,7 +70,10 @@ sub _readrc
        next;
       }
 
-     push(@tok, split(/[\s\n]+/, $_));
+     s/^\s*//;
+     chomp;
+     push(@tok, $+)
+       while(length && s/^("([^"]*)"|(\S+))\s*//);
 
 TOKEN:
      while(@tok)
@@ -92,7 +95,7 @@ TOKEN:
        if($tok eq "machine")
         {
          my $host = shift @tok;
-         $mach = bless {machine => $mach};
+         $mach = bless {machine => $host};
 
          $netrc{$host} = []
             unless exists($netrc{$host});