[Asterisk-code-review] sorcery: Use more compatible regex for local expressions. (asterisk[14])
Joshua Colp
asteriskteam at digium.com
Tue Aug 2 05:25:28 CDT 2016
Joshua Colp has uploaded a new change for review.
https://gerrit.asterisk.org/3393
Change subject: sorcery: Use more compatible regex for local expressions.
......................................................................
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
---
M res/res_sorcery_config.c
M res/res_sorcery_memory.c
2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/93/3393/1
diff --git a/res/res_sorcery_config.c b/res/res_sorcery_config.c
index dd4ea88..6059a52 100644
--- a/res/res_sorcery_config.c
+++ b/res/res_sorcery_config.c
@@ -210,6 +210,10 @@
.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 db1fc1a..774c955 100644
--- a/res/res_sorcery_memory.c
+++ b/res/res_sorcery_memory.c
@@ -188,6 +188,10 @@
.regex = &expression,
};
+ if (ast_strlen_zero(regex)) {
+ regex = ".";
+ }
+
if (regcomp(&expression, regex, REG_EXTENDED | REG_NOSUB)) {
return;
}
--
To view, visit https://gerrit.asterisk.org/3393
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9166dd176f1597555ba22b6931180d0626c1388
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
More information about the asterisk-code-review
mailing list