From cdda4aa8d20c2679cc937d40e793abe7806f17cb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 28 Jan 2015 14:03:31 +0100 Subject: list: properly skip over first item in LIST_FOREACH_OTHERS --- src/shared/list.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/shared/list.h b/src/shared/list.h index 7ed63188ba..2939216adb 100644 --- a/src/shared/list.h +++ b/src/shared/list.h @@ -144,6 +144,8 @@ (i) = (p); \ while ((i) && (i)->name##_prev) \ (i) = (i)->name##_prev; \ + if ((i) == (p)) \ + (i) = (p)->name##_next; \ }); \ (i); \ (i) = (i)->name##_next == (p) ? (p)->name##_next : (i)->name##_next) -- cgit v1.2.3-54-g00ecf