aboutsummaryrefslogtreecommitdiff
path: root/libbb/llist.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-25 00:33:44 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-25 00:33:44 +0000
commitc8400a216206a848f6c4b83b668df37f6fb546ee (patch)
tree4aa28c4440e6c150a31188f1910b6a945176c27c /libbb/llist.c
parent44c7917cab43713a034622bfb6e464de92cf8f1c (diff)
downloadbusybox-w32-c8400a216206a848f6c4b83b668df37f6fb546ee.tar.gz
busybox-w32-c8400a216206a848f6c4b83b668df37f6fb546ee.tar.bz2
busybox-w32-c8400a216206a848f6c4b83b668df37f6fb546ee.zip
wget: wget $'-\207' ... should not be allowed to work. ever. :)
So fix wget & getopt32. Also fix multiple --header options order: add and use rev_llist.
Diffstat (limited to 'libbb/llist.c')
-rw-r--r--libbb/llist.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbb/llist.c b/libbb/llist.c
index 8bf89a595..8a74832ee 100644
--- a/libbb/llist.c
+++ b/libbb/llist.c
@@ -62,3 +62,17 @@ void llist_free(llist_t *elm, void (*freeit)(void *data))
62 if (freeit) freeit(data); 62 if (freeit) freeit(data);
63 } 63 }
64} 64}
65
66/* Reverse list order. Useful since getopt32 saves option params
67 * in reverse order */
68llist_t* rev_llist(llist_t *list)
69{
70 llist_t *new = NULL;
71 while (list) {
72 llist_t *next = list->link;
73 list->link = new;
74 new = list;
75 list = next;
76 }
77 return new;
78}