-
-
Save LebedevRI/99d6d9753f2f02e5937fbea663307a45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gchar *_string_get_next_variable(gchar *string, gchar *variable, const size_t variable_size) | |
{ | |
gchar *end = NULL; | |
gchar *start = g_strstr_len(string, -1, "$("); | |
if(start) | |
{ | |
end = g_strstr_len(start, -1, ")"); | |
if(end) | |
{ | |
*end = '\0'; | |
g_strlcpy(variable, start, variable_size); | |
// the string in variable is null terminated | |
end++; | |
} | |
} | |
return end; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment