aboutsummaryrefslogtreecommitdiff
path: root/modutils/modprobe.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-15 02:17:31 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-15 02:17:31 +0100
commit5dad4aeedebf028b6682b344c335cd73e7eabb05 (patch)
treeada83afb8c42904f4d91320b4b31084ddef7ea5d /modutils/modprobe.c
parentdf7f2008c2a3a54437d2678b8d53eddaf136eb89 (diff)
downloadbusybox-w32-5dad4aeedebf028b6682b344c335cd73e7eabb05.tar.gz
busybox-w32-5dad4aeedebf028b6682b344c335cd73e7eabb05.tar.bz2
busybox-w32-5dad4aeedebf028b6682b344c335cd73e7eabb05.zip
modprobe: fix "modprobe -l name-with-dash"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r--modutils/modprobe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index 0d28da7ea..7ae459826 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -530,10 +530,14 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
530 xchdir(G.uts.release); 530 xchdir(G.uts.release);
531 531
532 if (opt & OPT_LIST_ONLY) { 532 if (opt & OPT_LIST_ONLY) {
533 int i;
533 char name[MODULE_NAME_LEN]; 534 char name[MODULE_NAME_LEN];
534 char *colon, *tokens[2]; 535 char *colon, *tokens[2];
535 parser_t *p = config_open2(CONFIG_DEFAULT_DEPMOD_FILE, xfopen_for_read); 536 parser_t *p = config_open2(CONFIG_DEFAULT_DEPMOD_FILE, xfopen_for_read);
536 537
538 for (i = 0; argv[i]; i++)
539 replace(argv[i], '-', '_');
540
537 while (config_read(p, tokens, 2, 1, "# \t", PARSE_NORMAL)) { 541 while (config_read(p, tokens, 2, 1, "# \t", PARSE_NORMAL)) {
538 colon = last_char_is(tokens[0], ':'); 542 colon = last_char_is(tokens[0], ':');
539 if (!colon) 543 if (!colon)
@@ -543,7 +547,6 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
543 if (!argv[0]) 547 if (!argv[0])
544 puts(tokens[0]); 548 puts(tokens[0]);
545 else { 549 else {
546 int i;
547 for (i = 0; argv[i]; i++) { 550 for (i = 0; argv[i]; i++) {
548 if (fnmatch(argv[i], name, 0) == 0) { 551 if (fnmatch(argv[i], name, 0) == 0) {
549 puts(tokens[0]); 552 puts(tokens[0]);