Skip to content

Commit

Permalink
Avoid re-scanning the string
Browse files Browse the repository at this point in the history
Thanks-to: @xiota and @andy5995
  • Loading branch information
rootkea committed Nov 25, 2021
1 parent 2dfb361 commit 4294a1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/build.c
Expand Up @@ -1057,13 +1057,13 @@ gboolean build_parse_make_dir(const gchar *string, gchar **prefix)
if (string == NULL)
return FALSE;

if ((pos = strstr(string, "Entering directory")) != NULL)
if ((pos = strstr(string, "Entering directory `")) != NULL)
{
gsize len;
gchar *input;

/* get the start of the path */
pos = strstr(string, "/");
/* get the start of the path skipping strlen("Entering directory `") = 20 bytes*/
pos = strchr(pos + 20, "/");

if (pos == NULL)
return FALSE;
Expand Down

0 comments on commit 4294a1d

Please sign in to comment.