Comment 2 for bug 801336

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

Confirmed in oneiric. Usually Unix command use the '--' special flag to specify that there is no option in the remaining arguments. But apt-file protect the minus sign before passing it to zfgrep.

A possible fix would be to always protect the arguments passed to zfgrep like this:
--- /usr/bin/apt-file 2011-06-23 23:10:22.000000000 +0200
+++ ./apt-file.new 2011-06-23 23:13:04.000000000 +0200
@@ -355,7 +355,7 @@
         else {
             my $zgrep_pattern = $Conf->{pattern};
             $zgrep_pattern =~ s{^\\/}{};
- $zcat = "zfgrep $ignore_case $zgrep_pattern";
+ $zcat = "zfgrep $ignore_case -- $zgrep_pattern";
         }
     }
     my $regexp = eval { $Conf->{ignore_case} ? qr/$pattern/i : qr/$pattern/ };

You can then call:
apt-file search -- -gtkmozembed