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

** Changed in: apt-file (Ubuntu)
   Importance: Undecided => Medium

** Changed in: apt-file (Ubuntu)
       Status: New => Triaged

** Tags added: patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/801336

Title:
  apt-file cannot search for patterns starting with -

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt-file/+bug/801336/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to