[Github-comments] [geany/geany] Avoid re-scanning the string (PR #2962)

xiota notifications at xxxxx
Thu Nov 25 05:52:48 UTC 2021


@xiota commented on this pull request.



> @@ -1057,7 +1057,7 @@ gboolean build_parse_make_dir(const gchar *string, gchar **prefix)
 	if (string == NULL)
 		return FALSE;
 
-	if ((pos = strstr(string, "Entering directory")) != NULL)
+	if (strstr(string, "Entering directory") != NULL)

Upon further reflection... the change I suggested rescans the "Entering directory" portion of the string...  Should probably be (but haven't tested):
```C
pos = strchr(pos + 18, '/');
```
>From search, the string looks like:
```
make[1]: Entering directory `/mnt/lfs/sources/gcc-build'
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2962#discussion_r756589190
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211124/760e6fb9/attachment-0001.htm>


More information about the Github-comments mailing list