]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Revision 189537 was supposed to make 1.4 more correct. Instead, it broke func_odbc...
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 29 Jun 2009 19:36:01 +0000 (19:36 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 29 Jun 2009 19:36:01 +0000 (19:36 +0000)
(closes issue #15317, issue #14614)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204170 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_odbc.c
funcs/func_strings.c

index 5052d1c17c618f32dbb56937dd54904897fb60dd..49007d7923aa3cdea42243b14bfddd0562d0455e 100644 (file)
@@ -227,9 +227,6 @@ static int acf_odbc_read(struct ast_channel *chan, char *cmd, char *s, char *buf
        SQLSMALLINT colcount=0;
        SQLLEN indicator;
 
-       /* Reset, in case of an error */
-       pbx_builtin_setvar_helper(chan, "~ODBCVALUES~", "");
-
        AST_LIST_LOCK(&queries);
        AST_LIST_TRAVERSE(&queries, query, list) {
                if (!strcmp(query->acf->name, cmd)) {
@@ -348,9 +345,9 @@ static int acf_odbc_read(struct ast_channel *chan, char *cmd, char *s, char *buf
                        return -1;
                }
 
-               /* Copy data, encoding '\', ',', '"', and '|' for the argument parser */
+               /* Copy data, encoding '\' and ',' for the argument parser */
                for (i = 0; i < sizeof(coldata); i++) {
-                       if (escapecommas && strchr("\\,|\"", coldata[i])) {
+                       if (escapecommas && (coldata[i] == '\\' || coldata[i] == ',')) {
                                buf[buflen++] = '\\';
                        }
                        buf[buflen++] = coldata[i];
@@ -371,10 +368,6 @@ static int acf_odbc_read(struct ast_channel *chan, char *cmd, char *s, char *buf
        SQLCloseCursor(stmt);
        SQLFreeHandle(SQL_HANDLE_STMT, stmt);
        ast_odbc_release_obj(obj);
-
-       /* Pass an unadulterated string to ARRAY, if needed.  This is only needed
-        * in 1.4, because of the misfeature in Set. */
-       pbx_builtin_setvar_helper(chan, "~ODBCVALUES~", buf);
        if (chan)
                ast_autoservice_stop(chan);
        if (bogus_chan)
index 05161d04c758788027ce6cde45a979b953dbd623..8b0d562ba948015e0645e09cfd61ba0b37f75e65 100644 (file)
@@ -162,23 +162,6 @@ static struct ast_custom_function regex_function = {
        .read = regex,
 };
 
-static int strecmp(const char *pre, const char *post)
-{
-       int res;
-       for (; *pre && *post; pre++, post++) {
-               if (*pre == '"') {
-                       post--;
-                       continue;
-               } else if (*pre == '\\') {
-                       pre++;
-               }
-               if ((res = strncmp(pre, post, 1))) {
-                       return res;
-               }
-       }
-       return strncmp(pre, post, 1);
-}
-
 static int array(struct ast_channel *chan, char *cmd, char *var,
                 const char *value)
 {
@@ -191,15 +174,6 @@ static int array(struct ast_channel *chan, char *cmd, char *var,
        char *value2;
        int i;
 
-       if (chan) {
-               const char *value3;
-               ast_mutex_lock(&chan->lock);
-               if ((value3 = pbx_builtin_getvar_helper(chan, "~ODBCVALUES~")) && strecmp(value3, value) == 0) {
-                       value = ast_strdupa(value3);
-               }
-               ast_mutex_unlock(&chan->lock);
-       }
-
        value2 = ast_strdupa(value);
        if (!var || !value2)
                return -1;