[haiku-bugs] Re: [Haiku] #15650: TextSearch: search string is not properly escaped when passing in grep

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Thu, 23 Jan 2020 22:26:03 -0000

#15650: TextSearch: search string is not properly escaped when passing in grep
---------------------------------------+----------------------------
   Reporter:  X512                     |      Owner:  phoudoin
       Type:  bug                      |     Status:  new
   Priority:  normal                   |  Milestone:  Unscheduled
  Component:  Applications/TextSearch  |    Version:  R1/Development
 Resolution:                           |   Keywords:
 Blocked By:                           |   Blocking:
Has a Patch:  0                        |   Platform:  All
---------------------------------------+----------------------------
Comment (by phoudoin):

 Damn.
 Please someone can add these lines in
 Grepper.cpp:Grepper::_RunnerThread(), line 274:

 {{{#!diff
 --- Version a
 +++ Version b
 @@ -266,10 +266,13 @@
      // grep command driven by xargs dispatcher
      argv[argc++] = "grep";
      argv[argc++] = "-n"; // need matching line(s) number(s)
      argv[argc++] = "-H"; // need filename prefix
      if (! fCaseSensitive)
          argv[argc++] = "-i";
      if (! fRegularExpression)
          argv[argc++] = "-F";    // no a regexp: force fixed string,
 +    // Add double dash argument to tell grep
 +    // it's the end of commands options
 +    argv[argc++] = "--";
      argv[argc++] = fPattern;
      argv[argc] = NULL;
 }}}

 ?
 Thanks
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15650#comment:1>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: