Opened 2 months ago

Last modified 2 months ago

#14336 new bug

TextSearch won't accept "--with-..." as search terms

Reported by: KapiX Owned by: phoudoin
Priority: normal Milestone: Unscheduled
Component: Applications/TextSearch Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

It seems it's passing the term to grep unescaped, and grep fails with "unrecognized argument".

Change History (2)

comment:1 Changed 2 months ago by phoudoin

with Regular Expression enabled of not?

A quick check shows that grep -F "--with-..." works, but grep "--with-..." doesn't.

I guess when Regular Expression is enabled, the -e option should be explicitly passed then, as `grep -e "--with-..." works as expected.

https://github.com/haiku/haiku/blob/master/src/apps/text_search/Grepper.cpp#L272

  • (a) current vs. (b) proposed

    a b  
    272     if (! fRegularExpression)
    273         argv[argc++] = "-F"; // no a regexp: force fixed string,
     272    argv[argc++] = fRegularExpression ? "-e" : "-F";
Last edited 2 months ago by phoudoin (previous) (diff)

comment:2 Changed 2 months ago by KapiX

It doesn't work in both cases. Exact term: --with-theme in libreoffice's source directory.

Note: See TracTickets for help on using tickets.