]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Thu, 24 Aug 2006 20:01:23 +0000 (20:01 +0000)
committerAutomerge script <automerge@asterisk.org>
Thu, 24 Aug 2006 20:01:23 +0000 (20:01 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@41003 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
include/asterisk/linkedlists.h
pbx.c

index 2f3950195d7a24a3cdc4cbcf31cfd65ac97a6f56..a55dcb38376451ffece53e687c8aba539b2f9915 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -2891,7 +2891,7 @@ static void clone_variables(struct ast_channel *original, struct ast_channel *cl
 
        AST_LIST_TRAVERSE_SAFE_BEGIN(&original->varshead, varptr, entries) {
                if (!strncmp(ast_var_name(varptr), GROUP_CATEGORY_PREFIX, strlen(GROUP_CATEGORY_PREFIX))) {
-                       AST_LIST_REMOVE(&original->varshead, varptr, entries);
+                       AST_LIST_REMOVE_CURRENT(&original->varshead, entries);
                        ast_var_delete(varptr);
                }
        }
@@ -2900,7 +2900,7 @@ static void clone_variables(struct ast_channel *original, struct ast_channel *cl
        /* Append variables from clone channel into original channel */
        /* XXX Is this always correct?  We have to in order to keep MACROS working XXX */
        if (AST_LIST_FIRST(&clone->varshead))
-               AST_LIST_INSERT_TAIL(&original->varshead, AST_LIST_FIRST(&clone->varshead), entries);
+               AST_LIST_APPEND_LIST(&original->varshead, &clone->varshead, entries);
 }
 
 /*--- ast_do_masquerade: Masquerade a channel */
index b91d1177824d257f3c0a1806debe6a2d0907ae64..3ac3bffa7d60fc1caa449fa52b4b2650f5538bac 100644 (file)
@@ -429,6 +429,23 @@ struct {                                                           \
       }                                                                        \
 } while (0)
 
+/*!
+  \brief Appends a whole list to the tail of a list.
+  \param head This is a pointer to the list head structure
+  \param list This is a pointer to the list to be appended.
+  \param field This is the name of the field (declared using AST_LIST_ENTRY())
+  used to link entries of this list together.
+ */
+#define AST_LIST_APPEND_LIST(head, list, field) do {                   \
+      if (!(head)->first) {                                            \
+               (head)->first = (list)->first;                          \
+               (head)->last = (list)->last;                            \
+      } else {                                                         \
+               (head)->last->field.next = (list)->first;               \
+               (head)->last = (list)->last;                            \
+      }                                                                        \
+} while (0)
+
 /*!
   \brief Removes and returns the head entry from a list.
   \param head This is a pointer to the list head structure
diff --git a/pbx.c b/pbx.c
index ad57810a9da72bcbf3f8ccc9471f0e044e405d16..f5461803959809d0a66183928ea7d290474db849 100644 (file)
--- a/pbx.c
+++ b/pbx.c
@@ -5906,9 +5906,7 @@ int pbx_builtin_serialize_variables(struct ast_channel *chan, char *buf, size_t
        memset(buf, 0, size);
 
        AST_LIST_TRAVERSE(&chan->varshead, variables, entries) {
-               if(variables &&
-                  (var=ast_var_name(variables)) && (val=ast_var_value(variables)) &&
-                  !ast_strlen_zero(var) && !ast_strlen_zero(val)) {
+               if ((var = ast_var_name(variables)) && (val = ast_var_value(variables))) {
                        if (ast_build_string(&buf, &size, "%s=%s\n", var, val)) {
                                ast_log(LOG_ERROR, "Data Buffer Size Exceeded!\n");
                                break;