aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-08-11 02:32:18 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-08-11 02:32:18 +0000
commitd2c6f9a1f9d5974155f1a7224aecbafba91631a1 (patch)
tree3058c904b26f9889476b23fefdf273d9bbeeb20c
parent65c8c7ba2775007fbd4f02272180900f665024f3 (diff)
downloadbusybox-w32-d2c6f9a1f9d5974155f1a7224aecbafba91631a1.tar.gz
busybox-w32-d2c6f9a1f9d5974155f1a7224aecbafba91631a1.tar.bz2
busybox-w32-d2c6f9a1f9d5974155f1a7224aecbafba91631a1.zip
Patch from Phil Blundellto improve substring match
-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}