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
This commit is contained in:
Joshua Colp 2016-08-01 16:08:15 +00:00
parent de7e9fe95b
commit 73bce50ef8
2 changed files with 8 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}