[svn-commits] kpfleming: branch 1.6.2 r201265 - in /branches/1.6.2: ./ include/asterisk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 17 07:06:19 CDT 2009


Author: kpfleming
Date: Wed Jun 17 07:06:16 2009
New Revision: 201265

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201265
Log:
Merged revisions 201262 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r201262 | kpfleming | 2009-06-17 07:04:17 -0500 (Wed, 17 Jun 2009) | 15 lines
  
  Merged revisions 201261 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r201261 | kpfleming | 2009-06-17 07:03:25 -0500 (Wed, 17 Jun 2009) | 9 lines
    
    Correct AST_LIST_APPEND_LIST behavior when list to be appended is empty.
    
    When the list to be appended is empty, and the list to be appended to is *not*,
    AST_LIST_APPEND_LIST would actually cause the target list to become broken,
    and no longer have a pointer to its last entry. This patch fixes the problem.
    
    (reported by Stanislaw Pitucha on the asterisk-dev mailing list)
  ........
................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/include/asterisk/linkedlists.h

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/include/asterisk/linkedlists.h
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/include/asterisk/linkedlists.h?view=diff&rev=201265&r1=201264&r2=201265
==============================================================================
--- branches/1.6.2/include/asterisk/linkedlists.h (original)
+++ branches/1.6.2/include/asterisk/linkedlists.h Wed Jun 17 07:06:16 2009
@@ -765,15 +765,18 @@
  * calling this macro (the list entries are \b moved to the target list).
  */
 #define AST_LIST_APPEND_LIST(head, list, field) do {			\
-      if (!(head)->first) {						\
+	if (!(list)->first) {						\
+		break;							\
+	}								\
+	if (!(head)->first) {						\
 		(head)->first = (list)->first;				\
 		(head)->last = (list)->last;				\
-      } else {								\
+	} else {							\
 		(head)->last->field.next = (list)->first;		\
 		(head)->last = (list)->last;				\
-      }									\
-      (list)->first = NULL;						\
-      (list)->last = NULL;						\
+	}								\
+	(list)->first = NULL;						\
+	(list)->last = NULL;						\
 } while (0)
 
 #define AST_RWLIST_APPEND_LIST AST_LIST_APPEND_LIST




More information about the svn-commits mailing list