diff options
author | Denys Vlasenko | 2015-01-27 09:52:18 +0100 |
---|---|---|
committer | Denys Vlasenko | 2015-01-27 09:52:18 +0100 |
commit | 1ecfe811fe2f70380170ef7d820e8150054e88ca (patch) | |
tree | 2ecabb7c7b054ae8146942d08f361380473fb0db /modutils/depmod.c | |
parent | 6968e081230fb6434a2a6f0eed39d538ea982f3f (diff) | |
download | busybox-1ecfe811fe2f70380170ef7d820e8150054e88ca.zip busybox-1ecfe811fe2f70380170ef7d820e8150054e88ca.tar.gz |
Apply post-1.23.0 patches, bump version to 1.23.11_23_1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/depmod.c')
-rw-r--r-- | modutils/depmod.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/modutils/depmod.c b/modutils/depmod.c index aa228ec..a41b3e4 100644 --- a/modutils/depmod.c +++ b/modutils/depmod.c @@ -51,7 +51,11 @@ static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARA info->dnext = info->dprev = info; info->name = xstrdup(fname + 2); /* skip "./" */ - info->modname = xstrdup(filename2modname(fname, modname)); + info->modname = xstrdup( + filename2modname( + bb_get_last_path_component_nostrip(fname), + modname + )); for (ptr = image; ptr < image + len - 10; ptr++) { if (strncmp(ptr, "depends=", 8) == 0) { char *u; @@ -242,17 +246,18 @@ int depmod_main(int argc UNUSED_PARAM, char **argv) if (!(option_mask32 & OPT_n)) xfreopen_write("modules.alias", stdout); for (m = modules; m != NULL; m = m->next) { + char modname[MODULE_NAME_LEN]; const char *fname = bb_basename(m->name); - int fnlen = strchrnul(fname, '.') - fname; + filename2modname(fname, modname); while (m->aliases) { /* Last word can well be m->modname instead, * but depmod from module-init-tools 3.4 * uses module basename, i.e., no s/-/_/g. * (pathname and .ko.* are still stripped) * Mimicking that... */ - printf("alias %s %.*s\n", + printf("alias %s %s\n", (char*)llist_pop(&m->aliases), - fnlen, fname); + modname); } } #endif @@ -260,12 +265,13 @@ int depmod_main(int argc UNUSED_PARAM, char **argv) if (!(option_mask32 & OPT_n)) xfreopen_write("modules.symbols", stdout); for (m = modules; m != NULL; m = m->next) { + char modname[MODULE_NAME_LEN]; const char *fname = bb_basename(m->name); - int fnlen = strchrnul(fname, '.') - fname; + filename2modname(fname, modname); while (m->symbols) { - printf("alias symbol:%s %.*s\n", + printf("alias symbol:%s %s\n", (char*)llist_pop(&m->symbols), - fnlen, fname); + modname); } } #endif |