locate plugin with globbing

Bug #334798 reported by Salil on 2009-02-26
Affects Status Importance Assigned to Milestone
Do Plugins
Alex Launi

Bug Description

The locate plugin does not work correctly if the query has globbing characters. eg 'foo*bar' will not return anything even if 'foo bar' exists (and can be found by locate)

the reason appears to be the following:
// Only allow files that contain the query as a substring
// of the file name. It may be faster to use grep, but I've
// tested this and it seems prety snappy.
if (Path.GetFileName (path).ToLower().Contains (query)) {
  files.Add (Services.UniverseFactory.NewFileItem (path) as Item);

This whole thing is unnecessary.. the "-b" option to locate does what's intended here, without causing the problems that this is causing. I've attached a patch to fix this. Note however that the patch is entirely untested since I don't have compilers etc for C# (but it is such a simple patch that it should not be a problem)

Also it would be nice to have an option that lets me use the regex features of locate. Should I file a separate bug?

Salil (hellfeuer) wrote :
Alex Launi (alexlauni) on 2009-02-28
Changed in do-plugins:
assignee: nobody → alexlauni
importance: Undecided → Wishlist
status: New → Fix Committed
Chris S. (cszikszoy) on 2009-03-14
Changed in do-plugins:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments