aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modutils/modprobe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index fd984e446..ddf63ab70 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 )
370 mod_ext = ".ko"; 370 mod_ext = ".ko";
371#endif 371#endif
372 372
373 return (strncmp(last_comp ? last_comp + 1 : mod_path, 373 last_comp = last_comp ? last_comp + 1 : mod_path;
374
375 return (strncmp(last_comp,
374 mod_name, 376 mod_name,
375 strlen(mod_name)) == 0 ) && 377 strlen(mod_name)) == 0 ) &&
378 ((strcmp(last_comp + strlen (mod_name), mod_ext) == 0) || last_comp[strlen(mod_name)] == 0) &&
376 (strcmp(mod_path + strlen(mod_path) - 379 (strcmp(mod_path + strlen(mod_path) -
377 strlen(mod_ext), mod_ext) == 0); 380 strlen(mod_ext), mod_ext) == 0);
378} 381}