]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DoSearchContents.pm
Make short descriptions translatable
[deb/packages.git] / lib / Packages / DoSearchContents.pm
index 1be7d441cc90e25c6da65a0b855a2916d809e8ff..93a20265adc4d84925451ef8da86c258defdd618 100644 (file)
@@ -5,8 +5,6 @@ use warnings;
 
 use Benchmark ':hireswallclock';
 use DB_File;
-use URI::Escape;
-use HTML::Entities;
 use Exporter;
 our @ISA = qw( Exporter );
 our @EXPORT = qw( do_search_contents );
@@ -173,8 +171,15 @@ sub searchfile
        last unless index($key, $kw) == 0;
        debug( "found $key", 2 ) if DEBUG;
 
-       my @hits = split /\0/o, $value;
-       push @$results, [ scalar reverse($key), @hits ];
+       my @files = split /\001/o, $value;
+       foreach my $f (@files) {
+           my @hits = split /\0/o, $f;
+           my $file = shift @hits;
+           if ($file eq '-') {
+               $file = reverse($key);
+           }
+           push @$results, [ $file, @hits ];
+       }
        last if ($$nres)++ > 100;
     }