r1849 - trunk/data/qcsrc/common
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Aug 23 12:26:32 EDT 2006
Author: div0
Date: 2006-08-23 12:26:32 -0400 (Wed, 23 Aug 2006)
New Revision: 1849
Modified:
trunk/data/qcsrc/common/util.qc
Log:
And this time, a REAL fix.
Modified: trunk/data/qcsrc/common/util.qc
===================================================================
--- trunk/data/qcsrc/common/util.qc 2006-08-23 08:59:52 UTC (rev 1848)
+++ trunk/data/qcsrc/common/util.qc 2006-08-23 16:26:32 UTC (rev 1849)
@@ -25,14 +25,20 @@
}
else
{
- for (j = i;j < strlen(s);j++)
+ for (j = i+1;j < strlen(s);j++)
+ // ^^ this skips over the first character of a word, which
+ // is ALWAYS part of the word
+ // this is safe since if i+1 == strlen(s), i will become
+ // strlen(s)-1 at the end of this block and the function
+ // will terminate. A space can't be the first character we
+ // read here, and neither can a \n be the start, since these
+ // two cases have been handled above.
{
c = substring(s, j, 1);
if (c == " ")
break;
if (c == "\\")
- if(j+1 < strlen(s))
- break;
+ break;
// we need to keep this tempstring alive even if substring is
// called repeatedly, so call strcat even though we're not
// doing anything
More information about the nexuiz-commits
mailing list