list: LIST_INSERT_BEFORE: update head if necessary (#4261)
If the new item is inserted before the first item in the list, then the head must be updated as well. Add a test to the list unit test to check for this.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
c080fbce9c
commit
5076f4219e
@@ -142,6 +142,8 @@
|
||||
} else { \
|
||||
if ((_b->name##_prev = _a->name##_prev)) \
|
||||
_b->name##_prev->name##_next = _b; \
|
||||
else \
|
||||
*_head = _b; \
|
||||
_b->name##_next = _a; \
|
||||
_a->name##_prev = _b; \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user