debugcmd.c:execute_cmd:added skip counter which adjusts the starting position of next argument correctly thus avoiding cropping the latter quoted argument.
This commit is contained in:
VilhoRaatikka 2015-01-19 18:38:46 +02:00
parent 5d1f029260
commit 272cd73cad

View File

@ -742,6 +742,7 @@ unsigned long arg1, arg2, arg3;
int in_quotes = 0, escape_next = 0;
char *ptr, *lptr;
bool in_space = false;
int nskip = 0;
args[0] = cli->cmdbuf;
ptr = args[0];
@ -770,6 +771,8 @@ bool in_space = false;
{
*lptr = 0;
lptr += nskip;
nskip = 0;
if(!in_space){
break;
@ -791,11 +794,13 @@ bool in_space = false;
{
in_quotes = 1;
ptr++;
nskip++;
}
else if (*ptr == '\"' && in_quotes == 1)
{
in_quotes = 0;
ptr++;
nskip++;
}
else
{