Bugfix: Correctly handle missing ending double quotes (+test) (Thanks mxf)
This commit is contained in:
parent
2daa8d422a
commit
82247fd0ab
|
@ -249,7 +249,7 @@ char *parse_command(const char *input) {
|
||||||
if (*walk == '"') {
|
if (*walk == '"') {
|
||||||
beginning++;
|
beginning++;
|
||||||
walk++;
|
walk++;
|
||||||
while (*walk != '"' || *(walk-1) == '\\')
|
while (*walk != '\0' && (*walk != '"' || *(walk-1) == '\\'))
|
||||||
walk++;
|
walk++;
|
||||||
} else {
|
} else {
|
||||||
if (token->name[0] == 's') {
|
if (token->name[0] == 's') {
|
||||||
|
|
|
@ -165,6 +165,10 @@ is(parser_calls('workspace "foo"'),
|
||||||
'cmd_workspace_name(foo)',
|
'cmd_workspace_name(foo)',
|
||||||
'Command with simple double quotes ok');
|
'Command with simple double quotes ok');
|
||||||
|
|
||||||
|
is(parser_calls('workspace "foo'),
|
||||||
|
'cmd_workspace_name(foo)',
|
||||||
|
'Command without ending double quotes ok');
|
||||||
|
|
||||||
is(parser_calls('workspace "foo \"bar"'),
|
is(parser_calls('workspace "foo \"bar"'),
|
||||||
'cmd_workspace_name(foo "bar)',
|
'cmd_workspace_name(foo "bar)',
|
||||||
'Command with escaped double quotes ok');
|
'Command with escaped double quotes ok');
|
||||||
|
|
Loading…
Reference in New Issue