tags 375506 patch thanks On Thu, Jun 29, 2006 at 05:43:48PM +1000, Brendan O'Dea wrote: > > The shell handles glob expansion failure by falling back to using the > literal value. > > We could do something similar for --search (see patch following), > although note that while this means that '-S /usr/bin/[' now works, > '-S [' will not.
Just a variation of your patch with strstr instead of strcmp, '-S [' works. > It also doubles the comparisions required against every non-matching > file. On my box, it is only 10% slower for this dpkg call. Maybe this patch is worth being applied. Kind Regards, -- Nekral
Index: src/query.c =================================================================== --- src/query.c (révision 440) +++ src/query.c (copie de travail) @@ -294,7 +294,9 @@ } else { it= iterfilestart(); while ((namenode= iterfilenext(it)) != 0) { - if (fnmatch(thisarg,namenode->name,0)) continue; + if (fnmatch(thisarg,namenode->name,0) && + strstr(namenode->name, thisarg) == NULL) + continue; found+= searchoutput(namenode); } iterfileend(it);