r3177 - trunk/data/qcsrc/common

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jan 18 18:23:54 EST 2008


Author: div0
Date: 2008-01-18 18:23:53 -0500 (Fri, 18 Jan 2008)
New Revision: 3177

Modified:
   trunk/data/qcsrc/common/mapinfo.qc
Log:
use strcasecmp for map name comparisons


Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc	2008-01-18 20:48:22 UTC (rev 3176)
+++ trunk/data/qcsrc/common/mapinfo.qc	2008-01-18 23:23:53 UTC (rev 3177)
@@ -57,6 +57,10 @@
 {
 	return substring(haystack, 0, strlen(needle)) == needle;
 }
+float startsWithNocase(string haystack, string needle)
+{
+	return strcasecmp(substring(haystack, 0, strlen(needle)), needle) == 0;
+}
 string extractRestOfLine(string haystack, string needle)
 {
 	if(startsWith(haystack, needle))
@@ -532,7 +536,7 @@
 		MapInfo_FindName_firstResult = -1;
 		return -1; // no MapInfo_FindName_match, behind last item
 	}
-	if(!startsWith(MapInfo_FindName_match, s))
+	if(!startsWithNocase(MapInfo_FindName_match, s))
 	{
 		MapInfo_FindName_match = string_null;
 		MapInfo_FindName_firstResult = -1;
@@ -540,7 +544,7 @@
 	}
 	if(l == MapInfo_count - 1)
 		return l; // last one, nothing can follow => unique
-	if(startsWith(_MapInfo_GlobItem(HugeSetOfIntegers_get(_MapInfo_filtered, l + 1)), s))
+	if(startsWithNocase(_MapInfo_GlobItem(HugeSetOfIntegers_get(_MapInfo_filtered, l + 1)), s))
 	{
 		MapInfo_FindName_match = string_null;
 		return -1; // ambigous MapInfo_FindName_match




More information about the nexuiz-commits mailing list