summaryrefslogtreecommitdiff
path: root/modutils/modprobe.c
diff options
context:
space:
mode:
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 fd984e4..ddf63ab 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -370,9 +370,12 @@ static int mod_strcmp ( const char *mod_path, const char *mod_name )
mod_ext = ".ko";
#endif
- return (strncmp(last_comp ? last_comp + 1 : mod_path,
+ last_comp = last_comp ? last_comp + 1 : mod_path;
+
+ return (strncmp(last_comp,
mod_name,
strlen(mod_name)) == 0 ) &&
+ ((strcmp(last_comp + strlen (mod_name), mod_ext) == 0) || last_comp[strlen(mod_name)] == 0) &&
(strcmp(mod_path + strlen(mod_path) -
strlen(mod_ext), mod_ext) == 0);
}