Quellcode durchsuchen

dselect: Quote the FTP package name instead of trying to manually escape it

Guillem Jover vor 11 Jahren
Ursprung
Commit
b4e6a1c8bd
1 geänderte Dateien mit 1 neuen und 3 gelöschten Zeilen
  1. 1 3
      dselect/methods/ftp/install

+ 1 - 3
dselect/methods/ftp/install

@@ -369,12 +369,10 @@ sub download() {
               #Try to find another file or this package
 	      print "Looking for another version of the package...\n";
 	      my ($dir, $package) = ($fn =~ m{^(.*)/([^/]+)_[^/]+.deb$});
-	      my $protected = $package;
-	      $protected =~ s/\+/\\\+/g;
 	      my $list = $ftp->ls("$pre$dir");
 	      if ($ftp->ok() && ref($list)) {
 		foreach my $file (@{$list}) {
-		  if ($file =~ m/($dir\/${protected}_[^\/]+.deb)/i) {
+		  if ($file =~ m/($dir\/\Q$package\E_[^\/]+.deb)/i) {
 		    print "Package found : $file\n";
 		    print "getting: $file (size not known)\n";
 		    $res = $ftp->get($file, "$dldir/$1");