compatibility: match commands using fnmatch() instead of strcmp().

module-init-tools modprobe.c use fnmatch() and not strcmp() to match
commands and softdeps, although the man page does not say so. Then use
the same function to provide compatibility.
This commit is contained in:
Gustavo Sverzut Barbieri 2011-12-16 22:43:04 -02:00 committed by Lucas De Marchi
parent e793f1eae9
commit a6bf2495f6

View File

@ -835,7 +835,7 @@ KMOD_EXPORT const char *kmod_module_get_install_commands(const struct kmod_modul
kmod_list_foreach(l, ctx_install_commands) {
const char *modname = kmod_command_get_modname(l);
if (strcmp(modname, mod->name) != 0)
if (fnmatch(modname, mod->name, 0) != 0)
continue;
m->install_commands = kmod_command_get_command(l);
@ -993,7 +993,7 @@ KMOD_EXPORT const char *kmod_module_get_remove_commands(const struct kmod_module
kmod_list_foreach(l, ctx_remove_commands) {
const char *modname = kmod_command_get_modname(l);
if (strcmp(modname, mod->name) != 0)
if (fnmatch(modname, mod->name, 0) != 0)
continue;
m->remove_commands = kmod_command_get_command(l);