Fix to bug #701, http://bugs.mariadb.com/show_bug.cgi?id=701
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:
@ -742,6 +742,7 @@ unsigned long arg1, arg2, arg3;
|
|||||||
int in_quotes = 0, escape_next = 0;
|
int in_quotes = 0, escape_next = 0;
|
||||||
char *ptr, *lptr;
|
char *ptr, *lptr;
|
||||||
bool in_space = false;
|
bool in_space = false;
|
||||||
|
int nskip = 0;
|
||||||
|
|
||||||
args[0] = cli->cmdbuf;
|
args[0] = cli->cmdbuf;
|
||||||
ptr = args[0];
|
ptr = args[0];
|
||||||
@ -770,6 +771,8 @@ bool in_space = false;
|
|||||||
{
|
{
|
||||||
|
|
||||||
*lptr = 0;
|
*lptr = 0;
|
||||||
|
lptr += nskip;
|
||||||
|
nskip = 0;
|
||||||
|
|
||||||
if(!in_space){
|
if(!in_space){
|
||||||
break;
|
break;
|
||||||
@ -791,11 +794,13 @@ bool in_space = false;
|
|||||||
{
|
{
|
||||||
in_quotes = 1;
|
in_quotes = 1;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
nskip++;
|
||||||
}
|
}
|
||||||
else if (*ptr == '\"' && in_quotes == 1)
|
else if (*ptr == '\"' && in_quotes == 1)
|
||||||
{
|
{
|
||||||
in_quotes = 0;
|
in_quotes = 0;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
nskip++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user