diff options
author | Joshua Colp <jcolp@digium.com> | 2016-08-01 16:08:15 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2016-08-02 10:25:16 +0000 |
commit | 102d28c11a0f74c275613f893e9708b5ab2b4e11 (patch) | |
tree | e9edaeb9cb19273631f13be07da6ebf79c1bea8e | |
parent | f2a93dc9f2ca05bc0e03c64a8f3d368caf394628 (diff) |
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
-rw-r--r-- | res/res_sorcery_config.c | 4 | ||||
-rw-r--r-- | res/res_sorcery_memory.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/res/res_sorcery_config.c b/res/res_sorcery_config.c index 220b5875f..056f63eaa 100644 --- a/res/res_sorcery_config.c +++ b/res/res_sorcery_config.c @@ -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; } diff --git a/res/res_sorcery_memory.c b/res/res_sorcery_memory.c index e8f603038..b2f05591b 100644 --- a/res/res_sorcery_memory.c +++ b/res/res_sorcery_memory.c @@ -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; } |