Make evaluation of channel variables consistently case-sensitive.

Due to inconsistencies in how variable names were evaluated, the
decision was made to make all evaluations case-sensitive. See the
UPGRADE.txt file or https://wiki.asterisk.org/wiki/display/AST/Case+Sensitivity
for more details.

(closes issue ASTERISK-20163)
reported by Matt Jordan

Review: https://reviewboard.asterisk.org/r/2160


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2012-10-29 21:27:09 +00:00
parent 1eb14dbff8
commit da85f8489f
7 changed files with 67 additions and 70 deletions

View File

@@ -998,7 +998,7 @@ static void clearvar_prefix(struct ast_channel *chan, const char *prefix)
struct ast_var_t *var;
int len = strlen(prefix);
AST_LIST_TRAVERSE_SAFE_BEGIN(ast_channel_varshead(chan), var, entries) {
if (strncasecmp(prefix, ast_var_name(var), len) == 0) {
if (strncmp(prefix, ast_var_name(var), len) == 0) {
AST_LIST_REMOVE_CURRENT(entries);
ast_free(var);
}
@@ -1098,7 +1098,7 @@ static int hashkeys_read(struct ast_channel *chan, const char *cmd, char *data,
memset(buf, 0, len);
AST_LIST_TRAVERSE(ast_channel_varshead(chan), newvar, entries) {
if (strncasecmp(ast_str_buffer(prefix), ast_var_name(newvar), ast_str_strlen(prefix)) == 0) {
if (strncmp(ast_str_buffer(prefix), ast_var_name(newvar), ast_str_strlen(prefix)) == 0) {
/* Copy everything after the prefix */
strncat(buf, ast_var_name(newvar) + ast_str_strlen(prefix), len - strlen(buf) - 1);
/* Trim the trailing ~ */
@@ -1119,7 +1119,7 @@ static int hashkeys_read2(struct ast_channel *chan, const char *cmd, char *data,
ast_str_set(&prefix, -1, HASH_PREFIX, data);
AST_LIST_TRAVERSE(ast_channel_varshead(chan), newvar, entries) {
if (strncasecmp(ast_str_buffer(prefix), ast_var_name(newvar), ast_str_strlen(prefix)) == 0) {
if (strncmp(ast_str_buffer(prefix), ast_var_name(newvar), ast_str_strlen(prefix)) == 0) {
/* Copy everything after the prefix */
ast_str_append(buf, len, "%s", ast_var_name(newvar) + ast_str_strlen(prefix));
/* Trim the trailing ~ */