Port files.inc to transitional syntax.

This commit is contained in:
David Anderson
2014-11-15 13:42:28 -08:00
parent 5e362ec169
commit 79143d8b6e
8 changed files with 317 additions and 93 deletions
+9 -13
View File
@@ -35,32 +35,28 @@ public ReadSimpleUsers()
{
BuildPath(Path_SM, g_Filename, sizeof(g_Filename), "configs/admins_simple.ini");
new Handle:file = OpenFile(g_Filename, "rt");
if (file == INVALID_HANDLE)
File file = OpenFile(g_Filename, "rt");
if (!file)
{
ParseError("Could not open file!");
return;
}
while (!IsEndOfFile(file))
while (!file.EndOfFile())
{
decl String:line[255];
if (!ReadFileLine(file, line, sizeof(line)))
{
char line[255];
if (!file.ReadLine(line, sizeof(line)))
break;
}
/* Trim comments */
new len = strlen(line);
new bool:ignoring = false;
for (new i=0; i<len; i++)
int len = strlen(line);
bool ignoring = false;
for (int i=0; i<len; i++)
{
if (ignoring)
{
if (line[i] == '"')
{
ignoring = false;
}
} else {
if (line[i] == '"')
{
@@ -89,7 +85,7 @@ public ReadSimpleUsers()
ReadAdminLine(line);
}
CloseHandle(file);
file.Close();
}