diff options
author | Denys Vlasenko | 2011-02-15 02:17:31 +0100 |
---|---|---|
committer | Denys Vlasenko | 2011-02-15 02:17:31 +0100 |
commit | 5dad4aeedebf028b6682b344c335cd73e7eabb05 (patch) | |
tree | ada83afb8c42904f4d91320b4b31084ddef7ea5d /modutils | |
parent | df7f2008c2a3a54437d2678b8d53eddaf136eb89 (diff) | |
download | busybox-5dad4aeedebf028b6682b344c335cd73e7eabb05.zip busybox-5dad4aeedebf028b6682b344c335cd73e7eabb05.tar.gz |
modprobe: fix "modprobe -l name-with-dash"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/modprobe.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 0d28da7..7ae4598 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -530,10 +530,14 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) xchdir(G.uts.release); if (opt & OPT_LIST_ONLY) { + int i; char name[MODULE_NAME_LEN]; char *colon, *tokens[2]; parser_t *p = config_open2(CONFIG_DEFAULT_DEPMOD_FILE, xfopen_for_read); + for (i = 0; argv[i]; i++) + replace(argv[i], '-', '_'); + while (config_read(p, tokens, 2, 1, "# \t", PARSE_NORMAL)) { colon = last_char_is(tokens[0], ':'); if (!colon) @@ -543,7 +547,6 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) if (!argv[0]) puts(tokens[0]); else { - int i; for (i = 0; argv[i]; i++) { if (fnmatch(argv[i], name, 0) == 0) { puts(tokens[0]); |