[Asterisk-code-review] sorcery: Use more compatible regex for local expressions. (asterisk[13])
Joshua Colp
asteriskteam at digium.com
Tue Aug 2 05:25:19 CDT 2016
Joshua Colp has uploaded a new change for review.
https://gerrit.asterisk.org/3392
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/92/3392/1
diff --git a/res/res_sorcery_config.c b/res/res_sorcery_config.c
index 220b587..056f63e 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 e8f6030..b2f0559 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/3392
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9166dd176f1597555ba22b6931180d0626c1388
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
More information about the asterisk-code-review
mailing list