aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-26 13:30:41 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-26 13:30:41 +0000
commitdc5d7fec350532d191ecfef49fa8b9b208b09f9f (patch)
treeeb7b9c048085331de5230b690b02e423175cd397
parent423465cd5e673ce3561d420e6655e34dfe2a4ebd (diff)
downloadbusybox-w32-dc5d7fec350532d191ecfef49fa8b9b208b09f9f.tar.gz
busybox-w32-dc5d7fec350532d191ecfef49fa8b9b208b09f9f.tar.bz2
busybox-w32-dc5d7fec350532d191ecfef49fa8b9b208b09f9f.zip
- remove some bloat -28b: now approx. 501b
-rw-r--r--modutils/depmod.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/modutils/depmod.c b/modutils/depmod.c
index 903b073f8..489a0330e 100644
--- a/modutils/depmod.c
+++ b/modutils/depmod.c
@@ -21,7 +21,7 @@ struct globals {
21static int fill_lst(const char *modulename, struct stat ATTRIBUTE_UNUSED *sb, 21static int fill_lst(const char *modulename, struct stat ATTRIBUTE_UNUSED *sb,
22 void ATTRIBUTE_UNUSED *data, int ATTRIBUTE_UNUSED depth) 22 void ATTRIBUTE_UNUSED *data, int ATTRIBUTE_UNUSED depth)
23{ 23{
24 llist_add_to_end(&G.lst, strdup(modulename)); 24 llist_add_to(&G.lst, strdup(modulename));
25 return TRUE; 25 return TRUE;
26} 26}
27 27
@@ -35,7 +35,6 @@ static int fileAction(const char *fname, struct stat ATTRIBUTE_UNUSED *sb,
35 RESERVE_CONFIG_BUFFER(depends, 512); 35 RESERVE_CONFIG_BUFFER(depends, 512);
36 RESERVE_CONFIG_BUFFER(buf1, 512); 36 RESERVE_CONFIG_BUFFER(buf1, 512);
37 37
38 memset(buf1, 0, sizeof(buf1));
39 memset(depends, 0, sizeof(depends)); 38 memset(depends, 0, sizeof(depends));
40 39
41 if (last_char_is(fname, 'o') == NULL) /* not a module */ 40 if (last_char_is(fname, 'o') == NULL) /* not a module */
@@ -55,7 +54,7 @@ static int fileAction(const char *fname, struct stat ATTRIBUTE_UNUSED *sb,
55 deps = depends; 54 deps = depends;
56 while (*deps) { 55 while (*deps) {
57 llist_t * _lst = G.lst; 56 llist_t * _lst = G.lst;
58 ptr = memchr(deps, ',', strlen(deps)); 57 ptr = strchr(deps, ',');
59 if (ptr != NULL) 58 if (ptr != NULL)
60 *(char*)ptr = '\0'; 59 *(char*)ptr = '\0';
61 /* remember the length of the current dependency plus eventual 0 byte */ 60 /* remember the length of the current dependency plus eventual 0 byte */
@@ -105,7 +104,9 @@ int depmod_main(int ATTRIBUTE_UNUSED argc, char **argv)
105 } 104 }
106 } while (*++argv); 105 } while (*++argv);
107 106
108 if (ENABLE_FEATURE_CLEAN_UP) 107 if (ENABLE_FEATURE_CLEAN_UP) {
109 fclose(filedes); 108 fclose(filedes);
109 llist_free(G.lst, free);
110 }
110 return retval; 111 return retval;
111} 112}