Fix handling of negative positional arguments

* wordsplit.c (expvar): Fix initial index
This commit is contained in:
Sergey Poznyakoff 2021-04-07 08:12:06 +03:00
parent ed0e91f0bd
commit 6ab5387624

View file

@ -1442,7 +1442,7 @@ expvar (struct wordsplit *wsp, const char *str, size_t len,
&& (str[1] == '-'
&& ISDIGIT (str[2]))))) != 0))
{
int i0 = str[0] == '-' ? 1 : 0;
int i0 = str[1] == '-' ? 1 : 0;
str++;
len--;
for (i = i0; i < len; i++)