commands.cxx

changeset 17
b4fcc69e426a
parent 16
393359908179
child 19
66993500719f
--- a/commands.cxx	Sat Jul 14 17:24:21 2012 +0300
+++ b/commands.cxx	Sat Jul 14 17:35:19 2012 +0300
@@ -163,7 +163,7 @@
 	// (are they real floats or fixed? how are they
 	// stored?) and add proper floating point support.
 	// NOTE: Also, shouldn't use RETURNVAL for data types..
-	t.tolower();
+	t = t.tolower();
 	return	!t.compare ("int") ? RETURNVAL_INT :
 		!t.compare ("float") ? RETURNVAL_INT :
 		!t.compare ("str") ? RETURNVAL_STRING :
@@ -183,14 +183,11 @@
 	return "";
 }
 
-CommandDef* GetCommandByName (str a) {
-	a.tolower ();
-	CommandDef* c;
-	ITERATE_COMMANDS (c) {
-		str b = c->name;
-		b.tolower ();
-		if (!a.compare (b))
-			return c;
+CommandDef* GetCommandByName (str fname) {
+	CommandDef* comm;
+	ITERATE_COMMANDS (comm) {
+		if (!fname.icompare (comm->name))
+			return comm;
 	}
 	
 	return NULL;

mercurial