From: Gustavo Sverzut Barbieri Date: Sat, 17 Dec 2011 00:43:04 +0000 (-0200) Subject: compatibility: match commands using fnmatch() instead of strcmp(). X-Git-Tag: v2~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6bf2495f6738c6a06028678e652f271bca8fc47;p=thirdparty%2Fkmod.git 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. --- diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index cb0ec3dc..6a64750b 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -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);