diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2004-08-11 06:32:18 +0400 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2004-08-11 06:32:18 +0400 |
commit | d2c6f9a1f9d5974155f1a7224aecbafba91631a1 (patch) | |
tree | 3058c904b26f9889476b23fefdf273d9bbeeb20c /modutils | |
parent | 65c8c7ba2775007fbd4f02272180900f665024f3 (diff) |
Patch from Phil Blundellto improve substring match
Diffstat (limited to 'modutils')
-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 ) 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); } |