Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix #14990 - multiple quoted command parsing issue ##core
	> "?e hello""?e world"
	hello
	world"
	> "?e hello";"?e world"
	hello
	world
  • Loading branch information
radare committed Sep 9, 2019
1 parent 5411543 commit dd739f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libr/core/cmd.c
Expand Up @@ -2580,6 +2580,7 @@ static int r_core_cmd_subst_i(RCore *core, char *cmd, char *colon, bool *tmpseek
cmd = sc + 1;
continue;
}
char op0 = 0;
if (*p) {
// workaround :D
if (p[0] == '@') {
Expand All @@ -2591,6 +2592,7 @@ static int r_core_cmd_subst_i(RCore *core, char *cmd, char *colon, bool *tmpseek
if (p[1] == '@' || (p[1] && p[2] == '@')) {
char *q = strchr (p + 1, '"');
if (q) {
op0 = *q;
*q = 0;
}
haveQuote = q != NULL;
Expand Down Expand Up @@ -2644,9 +2646,9 @@ static int r_core_cmd_subst_i(RCore *core, char *cmd, char *colon, bool *tmpseek
cmd = p + 1;
} else {
if (*p == '"') {
cmd = p + 1;
cmd = p;
} else {
*p = '"';
*p = op0;
cmd = p;
}
}
Expand Down

0 comments on commit dd739f5

Please sign in to comment.