Merge "res_sorcery_realtime: Fix regex regression."

This commit is contained in:
Joshua Colp 2016-02-03 10:14:45 -06:00 committed by Gerrit Code Review
commit ae1f728f0f
1 changed files with 5 additions and 1 deletions

View File

@ -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;