X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FPackages%2FDoSearchContents.pm;h=93a20265adc4d84925451ef8da86c258defdd618;hb=d02b6c592e4938cf4dc3113ca5fd92e4f79af6d8;hp=1be7d441cc90e25c6da65a0b855a2916d809e8ff;hpb=aee28210328cf1867daba3d397bf77d0baa24ccc;p=deb%2Fpackages.git diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index 1be7d44..93a2026 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -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; }