Skip to content
Snippets Groups Projects
Commit 73bce50e authored by Joshua Colp's avatar Joshua Colp
Browse files

sorcery: Use more compatible regex for local expressions.

This changes the use of an empty regex for both res_sorcery_config
and res_sorcery_memory to "." instead. This is a more compatible
regular expression which also works on FreeBSD.

ASTERISK-26206 #close

Change-Id: Ia9166dd176f1597555ba22b6931180d0626c1388
parent de7e9fe9
No related branches found
No related tags found
No related merge requests found
......@@ -210,6 +210,10 @@ static void sorcery_config_retrieve_regex(const struct ast_sorcery *sorcery, voi
.regex = &expression,
};
if (ast_strlen_zero(regex)) {
regex = ".";
}
if (!config_objects || regcomp(&expression, regex, REG_EXTENDED | REG_NOSUB)) {
return;
}
......
......@@ -188,6 +188,10 @@ static void sorcery_memory_retrieve_regex(const struct ast_sorcery *sorcery, voi
.regex = &expression,
};
if (ast_strlen_zero(regex)) {
regex = ".";
}
if (regcomp(&expression, regex, REG_EXTENDED | REG_NOSUB)) {
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment