--- grub-0.93/stage2/fsys_fat.c~	2001-12-19 19:17:06.000000000 +0800
+++ grub-0.93/stage2/fsys_fat.c	2004-11-15 11:25:40.000000000 +0800
@@ -63,6 +63,26 @@
   return word;
 }
 
+/* 2004-12-01 CyberLink Corp. <http://www.gocyberlink.com> */
+static inline int
+nsubstring (char *s1, char *s2)
+{
+    while (tolower(*s1) == tolower(*s2))
+    {
+	/* The strings match exactly. */
+	if (! *(s1++))
+	    return 0;
+	s2 ++;
+    }
+
+    /* S1 is a substring of S2. */
+    if (*s1 == 0)
+	return -1;
+
+    /* S1 isn't a substring. */
+    return 1;
+}
+
 int
 fat_mount (void)
 {
@@ -430,7 +449,8 @@
       if (do_possibilities)
 	{
 	print_filename:
-	  if (substring (dirname, filename) <= 0)
+/* 2004-12-01 CyberLink Corp. <http://www.gocyberlink.com> */
+	  if (nsubstring (dirname, filename) <= 0)
 	    {
 	      if (print_possibilities > 0)
 		print_possibilities = -print_possibilities;
@@ -440,7 +459,8 @@
 	}
 # endif /* STAGE1_5 */
       
-      if (substring (dirname, filename) == 0)
+/* 2004-12-01 CyberLink Corp. <http://www.gocyberlink.com> */
+      if (nsubstring (dirname, filename) == 0)
 	break;
     }
   
