termptyesc: _csi_arg_get() now correctly handles missing arguments

Only affects when multiple ones were expected
This commit is contained in:
Boris Faure 2017-06-01 23:29:55 +02:00
parent dbc75a0cc0
commit e0f6867a88
1 changed files with 14 additions and 1 deletions

View File

@ -96,9 +96,17 @@ _csi_arg_get(Eina_Unicode **ptr)
if (!b) if (!b)
goto error; goto error;
while ((*b) && (*b < '0' || *b > '9')) /* Skip potential '?', '>'.... */
while ((*b) && ( (*b) != ';' && ((*b) < '0' || (*b) > '9')))
b++; b++;
if (*b == ';')
{
b++;
*ptr = b;
return -1;
}
if (!*b) if (!*b)
goto error; goto error;
@ -111,6 +119,11 @@ _csi_arg_get(Eina_Unicode **ptr)
b++; b++;
} }
if (*b == ';')
{
b++;
}
*ptr = b; *ptr = b;
return sum; return sum;