diff options
author | Glenn L McGrath | 2004-08-11 02:32:18 +0000 |
---|---|---|
committer | Glenn L McGrath | 2004-08-11 02:32:18 +0000 |
commit | d2c6f9a1f9d5974155f1a7224aecbafba91631a1 (patch) | |
tree | 3058c904b26f9889476b23fefdf273d9bbeeb20c | |
parent | 65c8c7ba2775007fbd4f02272180900f665024f3 (diff) | |
download | busybox-d2c6f9a1f9d5974155f1a7224aecbafba91631a1.zip busybox-d2c6f9a1f9d5974155f1a7224aecbafba91631a1.tar.gz |
Patch from Phil Blundellto improve substring match
-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 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); } |