summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-02-03 10:14:45 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-02-03 10:14:45 -0600
commitae1f728f0f7f816a3e697a0c039046f23ec9ccf3 (patch)
tree9202fef7d092a29890bd7bddd964cec9b2b2a427
parent4b768281bbfd18f031d1522c17728b3a343411f6 (diff)
parent65223618717be8c6db93e324e2273b1dd79eb182 (diff)
Merge "res_sorcery_realtime: Fix regex regression."
-rw-r--r--res/res_sorcery_realtime.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c
index 1a30e0c59..83736a102 100644
--- a/res/res_sorcery_realtime.c
+++ b/res/res_sorcery_realtime.c
@@ -223,7 +223,11 @@ static void sorcery_realtime_retrieve_regex(const struct ast_sorcery *sorcery, v
/* The realtime API provides no direct ability to do regex so for now we support a limited subset using pattern matching */
snprintf(field, sizeof(field), "%s LIKE", UUID_FIELD);
- snprintf(value, sizeof(value), "%%%s%%", regex);
+ if (regex[0] == '^') {
+ snprintf(value, sizeof(value), "%s%%", regex + 1);
+ } else {
+ snprintf(value, sizeof(value), "%%%s%%", regex);
+ }
if (!(fields = ast_variable_new(field, value, ""))) {
return;