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)
|
||||
argv[argc++] = "-i";
|
||||
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] = NULL;
|
||||
|
||||
@@ -420,7 +423,7 @@ Grepper::_RunnerThread()
|
||||
if (strcmp(fileName, currentFileName) != 0) {
|
||||
fTarget.SendMessage(&message);
|
||||
|
||||
strncpy(currentFileName, fileName,
|
||||
strncpy(currentFileName, fileName,
|
||||
sizeof(currentFileName));
|
||||
|
||||
message.MakeEmpty();
|
||||
|
||||
Reference in New Issue
Block a user