aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-15 05:40:56 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-15 05:40:56 +0000
commitd50dda8c3501af9d593cd11272a15b480864a01c (patch)
tree652da97787e8e86f876b647ca9dab4b6b64fe291 /coreutils
parent873b895d50d69a45b52bef85a8a4fb190f9c89ce (diff)
downloadbusybox-w32-d50dda8c3501af9d593cd11272a15b480864a01c.tar.gz
busybox-w32-d50dda8c3501af9d593cd11272a15b480864a01c.tar.bz2
busybox-w32-d50dda8c3501af9d593cd11272a15b480864a01c.zip
*: 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
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/env.c3
-rw-r--r--coreutils/od_bloaty.c3
-rw-r--r--coreutils/sort.c4
3 files changed, 3 insertions, 7 deletions
diff --git a/coreutils/env.c b/coreutils/env.c
index e21740d98..8d8753e8b 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -62,8 +62,7 @@ int env_main(int argc ATTRIBUTE_UNUSED, char **argv)
62 environ = cleanenv; 62 environ = cleanenv;
63 } else { 63 } else {
64 while (unset_env) { 64 while (unset_env) {
65 unsetenv(unset_env->data); 65 unsetenv(llist_pop(&unset_env));
66 unset_env = unset_env->link;
67 } 66 }
68 } 67 }
69 68
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index 5e2287534..ce963db8a 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -1281,8 +1281,7 @@ int od_main(int argc, char **argv)
1281 if (opt & OPT_o) decode_format_string("o2"); 1281 if (opt & OPT_o) decode_format_string("o2");
1282 //if (opt & OPT_t)... 1282 //if (opt & OPT_t)...
1283 while (lst_t) { 1283 while (lst_t) {
1284 decode_format_string(lst_t->data); 1284 decode_format_string(llist_pop(&lst_t));
1285 lst_t = lst_t->link;
1286 } 1285 }
1287 if (opt & OPT_v) verbose = 1; 1286 if (opt & OPT_v) verbose = 1;
1288 if (opt & OPT_x) decode_format_string("x2"); 1287 if (opt & OPT_x) decode_format_string("x2");
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 12b463a6d..1f531fb76 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -314,7 +314,7 @@ int sort_main(int argc ATTRIBUTE_UNUSED, char **argv)
314 0 314 0
315 }; 315 };
316 struct sort_key *key = add_key(); 316 struct sort_key *key = add_key();
317 char *str_k = lst_k->data; 317 char *str_k = llist_pop(&lst_k);
318 const char *temp2; 318 const char *temp2;
319 319
320 i = 0; /* i==0 before comma, 1 after (-k3,6) */ 320 i = 0; /* i==0 before comma, 1 after (-k3,6) */
@@ -344,8 +344,6 @@ int sort_main(int argc ATTRIBUTE_UNUSED, char **argv)
344 str_k++; 344 str_k++;
345 } 345 }
346 } 346 }
347 /* leaking lst_k... */
348 lst_k = lst_k->link;
349 } 347 }
350#endif 348#endif
351 /* global b strips leading and trailing spaces */ 349 /* global b strips leading and trailing spaces */