diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-08-11 02:32:18 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-08-11 02:32:18 +0000 |
commit | 72d48ac3f15fdfbbfef7593705bf65e98a77bd3e (patch) | |
tree | 3058c904b26f9889476b23fefdf273d9bbeeb20c | |
parent | 6f8b1ccbf9ac6e4a563b1d4047f16c103c4689f7 (diff) | |
download | busybox-w32-72d48ac3f15fdfbbfef7593705bf65e98a77bd3e.tar.gz busybox-w32-72d48ac3f15fdfbbfef7593705bf65e98a77bd3e.tar.bz2 busybox-w32-72d48ac3f15fdfbbfef7593705bf65e98a77bd3e.zip |
Patch from Phil Blundellto improve substring match
git-svn-id: svn://busybox.net/trunk/busybox@9083 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | modutils/modprobe.c | 5 |
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 | } |