[INTERPRETER]

* BUG: Fix a crash in the &/ operator.


git-svn-id: svn://localhost/gambas/trunk@4725 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-05-12 23:49:07 +00:00
parent 659f1bf51f
commit 5917f3b3fe

View file

@ -149,25 +149,29 @@ void SUBR_file(ushort code)
i = NPARAM;
while (i--)
{
VALUE_get_string(PARAM, &addr, &len);
if (len > 0)
if (PARAM->type != T_NULL)
{
if (ptr > str)
VALUE_get_string(PARAM, &addr, &len);
if (len > 0)
{
if (!slash && *addr != '/')
*ptr++ = '/';
else if (slash && *addr == '/')
ptr--;
if (ptr > str)
{
if (!slash && *addr != '/')
*ptr++ = '/';
else if (slash && *addr == '/')
ptr--;
}
slash = addr[len - 1] == '/';
memcpy(ptr, addr, len);
ptr += len;
}
slash = addr[len - 1] == '/';
memcpy(ptr, addr, len);
ptr += len;
}
RELEASE_STRING(PARAM);
RELEASE_STRING(PARAM);
}
PARAM++;
}