mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 12:54:56 +00:00
Does nobody know how to write a linked list properly? I mean seriously!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -478,11 +478,13 @@ struct { \
|
|||||||
(head)->last = NULL; \
|
(head)->last = NULL; \
|
||||||
} else { \
|
} else { \
|
||||||
typeof(elm) curelm = (head)->first; \
|
typeof(elm) curelm = (head)->first; \
|
||||||
while (curelm->field.next != (elm)) \
|
while (curelm && (curelm->field.next != (elm))) \
|
||||||
curelm = curelm->field.next; \
|
curelm = curelm->field.next; \
|
||||||
curelm->field.next = (elm)->field.next; \
|
if (curelm) { \
|
||||||
if ((head)->last == (elm)) \
|
curelm->field.next = (elm)->field.next; \
|
||||||
(head)->last = curelm; \
|
if ((head)->last == (elm)) \
|
||||||
|
(head)->last = curelm; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user