From: Joshua Colp Date: Mon, 1 Aug 2016 16:08:15 +0000 (+0000) Subject: sorcery: Use more compatible regex for local expressions. X-Git-Tag: 13.12.0-rc1~160^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=102d28c11a0f74c275613f893e9708b5ab2b4e11;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_sorcery_config.c b/res/res_sorcery_config.c index 220b5875fe..056f63eaa2 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 e8f6030388..b2f05591bf 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; }