1
0
Fork 0
forked from fte/fteqw

Fix tokenizebyseparator with ',,,,' returning 3 tokens instead of 5.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5766 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-09-21 10:34:00 +00:00
parent b040358b54
commit e5f358ee5e

View file

@ -5634,7 +5634,7 @@ void QCBUILTIN PF_tokenizebyseparator (pubprogfuncs_t *prinst, struct globalvar
int seps = 0, s;
const char *start = str;
int tlen;
qboolean found = true;
int found;
while (seps < prinst->callargc - 1 && seps < 7)
{
@ -5671,7 +5671,7 @@ void QCBUILTIN PF_tokenizebyseparator (pubprogfuncs_t *prinst, struct globalvar
if (!*str)
{
qctoken[qctoken_count].end = str - start;
found = true;
found = -1;
}
else
{
@ -5704,12 +5704,12 @@ void QCBUILTIN PF_tokenizebyseparator (pubprogfuncs_t *prinst, struct globalvar
qctoken = n;
}
if (*str)
qctoken[qctoken_count].start = str - start;
else
if (found==-1)
break;
qctoken[qctoken_count].start = str - start;
}
str++;
else
str++;
}
G_FLOAT(OFS_RETURN) = qctoken_count;
}