[asterisk-commits] sorcery: Use more compatible regex for local expressions. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 2 12:21:12 CDT 2016


Joshua Colp has submitted this change and it was merged.

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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



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: merged
Gerrit-Change-Id: Ia9166dd176f1597555ba22b6931180d0626c1388
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list