fixed bug amb513, comments not being removed

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401113
This commit is contained in:
David Anderson 2007-07-14 01:46:28 +00:00
parent ee05ac6cfb
commit 91a1e2faaa

View File

@ -39,6 +39,36 @@ public ReadSimpleUsers()
break;
}
/* Trim comments */
new len = strlen(line);
new bool:ignoring = false;
for (new i=0; i<len; i++)
{
if (ignoring)
{
if (line[i] == '"')
{
ignoring = false;
}
} else {
if (line[i] == '"')
{
ignoring = true;
} else if (line[i] == ';') {
line[i] = '\0';
break;
} else if (line[i] == '/'
&& i != len - 1
&& line[i+1] == '/')
{
line[i] = '\0';
break;
}
}
}
TrimString(line);
if ((line[0] == '/' && line[1] == '/')
|| (line[0] == ';' || line[0] == '\0'))
{