[mirrorbrain-commits] r7945 - /trunk/tools/scanner.pl

From: <poeml_at_mirrorbrain.org>
Date: Tue, 26 Jan 2010 23:54:40 -0000
Author: poeml
Date: Wed Jan 27 00:54:38 2010
New Revision: 7945

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7945&view=rev
Log:
mb scan: - cleaner patch for r7944, avoiding a Perl warning.

Modified:
    trunk/tools/scanner.pl

Modified: trunk/tools/scanner.pl
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/tools/scanner.pl?rev=7945&r1=7944&r2=7945&view=diff
==============================================================================
--- trunk/tools/scanner.pl (original)
+++ trunk/tools/scanner.pl Wed Jan 27 00:54:38 2010
_at_@ -1194,11 +1194,13 @@
   my $port = 21;
   $port = $1 if $url =~ s{:(\d+)$}{};	# port number?
 
+  my $user = 'anonymous';
+  my $pass = "$0_at_" . Net::Domain::hostfqdn;
   my $auth = $1 if $url =~ s{^([^:]*:[^_at_]*)@}{};	# auth data?
-  my $user = $1 if $auth =~ s{^([^:]*):}{};
-  my $pass = $auth;
-  $user ||= 'anonymous';
-  $pass ||= "$0_at_" . Net::Domain::hostfqdn;
+  if (defined $auth) {
+    $user = $1 if $auth =~ s{^([^:]*):}{};
+    $pass = $auth;
+  }
 
   my $ftp = Net::FTP->new($url, Timeout => 360, Port => $port, Debug => (($verbose||0)>2)?1:0, Passive => 1, Hash => 0);
   unless (defined $ftp) {




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue Jan 26 2010 - 23:54:43 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT