]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
sorcery: Use more compatible regex for local expressions. 92/3392/1
authorJoshua Colp <jcolp@digium.com>
Mon, 1 Aug 2016 16:08:15 +0000 (16:08 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 2 Aug 2016 10:25:16 +0000 (10:25 +0000)
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

res/res_sorcery_config.c
res/res_sorcery_memory.c

index 220b5875fe5c3879aa7d25e8fe334c3e300399d1..056f63eaa21345cce2f47e452716fd5dff52ff80 100644 (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;
        }
index e8f6030388de262554799d46499c4f3b757b5e07..b2f05591bf10fd845a040bbbbe2698e5539da0b5 100644 (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;
        }