comparison toys/which.c @ 624:1e8b9acdafeb

Genericize llist code a bit: rename llist_free() to llist_traverse(), and no longer accept NULL as a synonym for free.
author Rob Landley <rob@landley.net>
date Sun, 15 Jul 2012 17:22:04 -0500
parents d51be130fda2
children
comparison
equal deleted inserted replaced
623:f51beec92738 624:1e8b9acdafeb
51 while (list) { 51 while (list) {
52 if (!access(list->str, X_OK)) { 52 if (!access(list->str, X_OK)) {
53 puts(list->str); 53 puts(list->str);
54 // If we should stop at one match, do so 54 // If we should stop at one match, do so
55 if (!toys.optflags) { 55 if (!toys.optflags) {
56 llist_free(list, NULL); 56 llist_traverse(list, free);
57 break; 57 break;
58 } 58 }
59 } 59 }
60 free(llist_pop(&list)); 60 free(llist_pop(&list));
61 } 61 }