*: use llist_pop for traverse-and-free list operation
function old new delta
append_file_list_to_list 109 111 +2
udhcpc_main 2414 2413 -1
run_parts_main 325 324 -1
od_main 2324 2323 -1
getopt_main 709 707 -2
env_main 253 251 -2
sed_main 659 656 -3
ps_main 522 519 -3
traceroute_main 3960 3954 -6
sort_main 844 838 -6
diff_main 866 858 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/10 up/down: 2/-33) Total: -31 bytes
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index 4b5a7d2..86c3348 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -137,7 +137,7 @@
opt_complementary = "vv:b::b-c:c-b";
f = getopt32(argv, "vb:c", &my_b, &verbose_level);
if (f & 2) // -c after -b unsets -b flag
- while (my_b) { dosomething_with(my_b->data); my_b = my_b->link; }
+ while (my_b) dosomething_with(llist_pop(&my_b));
if (my_b) // but llist is stored if -b is specified
free_llist(my_b);
if (verbose_level) printf("verbose level is %d\n", verbose_level);