TextSearch: fix passing search string to grep
Fix proposed by phoudoin. Fixes #15650. Change-Id: Ie7177aaa39ff593445506983cb0725b75ca7bc7d Reviewed-on: https://review.haiku-os.org/c/haiku/+/2149 Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
@@ -270,7 +270,10 @@ Grepper::_RunnerThread()
|
|||||||
if (! fCaseSensitive)
|
if (! fCaseSensitive)
|
||||||
argv[argc++] = "-i";
|
argv[argc++] = "-i";
|
||||||
if (! fRegularExpression)
|
if (! fRegularExpression)
|
||||||
argv[argc++] = "-F"; // no a regexp: force fixed string,
|
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++] = fPattern;
|
||||||
argv[argc] = NULL;
|
argv[argc] = NULL;
|
||||||
|
|
||||||
@@ -420,7 +423,7 @@ Grepper::_RunnerThread()
|
|||||||
if (strcmp(fileName, currentFileName) != 0) {
|
if (strcmp(fileName, currentFileName) != 0) {
|
||||||
fTarget.SendMessage(&message);
|
fTarget.SendMessage(&message);
|
||||||
|
|
||||||
strncpy(currentFileName, fileName,
|
strncpy(currentFileName, fileName,
|
||||||
sizeof(currentFileName));
|
sizeof(currentFileName));
|
||||||
|
|
||||||
message.MakeEmpty();
|
message.MakeEmpty();
|
||||||
|
|||||||
Reference in New Issue
Block a user