Browse Source

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

Guillem Jover 12 years ago
parent
commit
b4e6a1c8bd
1 changed files with 1 additions and 3 deletions
  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
               #Try to find another file or this package
 	      print "Looking for another version of the package...\n";
 	      print "Looking for another version of the package...\n";
 	      my ($dir, $package) = ($fn =~ m{^(.*)/([^/]+)_[^/]+.deb$});
 	      my ($dir, $package) = ($fn =~ m{^(.*)/([^/]+)_[^/]+.deb$});
-	      my $protected = $package;
-	      $protected =~ s/\+/\\\+/g;
 	      my $list = $ftp->ls("$pre$dir");
 	      my $list = $ftp->ls("$pre$dir");
 	      if ($ftp->ok() && ref($list)) {
 	      if ($ftp->ok() && ref($list)) {
 		foreach my $file (@{$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 "Package found : $file\n";
 		    print "getting: $file (size not known)\n";
 		    print "getting: $file (size not known)\n";
 		    $res = $ftp->get($file, "$dldir/$1");
 		    $res = $ftp->get($file, "$dldir/$1");