[BusyBox-cvs] CVS update of busybox/modutils (modprobe.c)

Glenn McGrath bug1 at codepoet.org
Wed Aug 11 02:32:19 UTC 2004


    Date: Tuesday, August 10, 2004 @ 20:32:19
  Author: bug1
    Path: /var/cvs/busybox/modutils

Modified: modprobe.c (1.35 -> 1.36)

Patch from Phil Blundellto improve substring match


Index: busybox/modutils/modprobe.c
diff -u busybox/modutils/modprobe.c:1.35 busybox/modutils/modprobe.c:1.36
--- busybox/modutils/modprobe.c:1.35	Tue Aug 10 20:30:30 2004
+++ busybox/modutils/modprobe.c	Tue Aug 10 20:32:18 2004
@@ -370,9 +370,12 @@
 		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);
 }



More information about the busybox-cvs mailing list