From fe91e68e8d1e6a2974b57a9855032ad94d137e8e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 22 Nov 2012 21:18:09 -0600 Subject: Remove readlink -m for being poorly defined ("readlink -m /dev/null/and/more" answers what question, exactly?), rewrite xabspath() to work right and not depend on realpath, fix subtle longstanding bug in llist_traverse(). --- lib/llist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/llist.c') diff --git a/lib/llist.c b/lib/llist.c index 9b6c2950..7b41fd08 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -8,12 +8,14 @@ // Call a function (such as free()) on each element of a linked list. void llist_traverse(void *list, void (*using)(void *data)) { + void *old = list; + while (list) { void *pop = llist_pop(&list); using(pop); // End doubly linked list too. - if (list==pop) break; + if (old == list) break; } } -- cgit v1.2.3