Do not execute subcommand under simple quotes protection.

Partially fix:
db/cmd/feat_quote Quotes and substitution - newshell

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
This commit is contained in:
Anthoine Bourgeois 2021-04-13 19:20:27 +02:00 committed by pancake
parent 6a6b8a0e41
commit 41339efd7c

View File

@ -3671,7 +3671,7 @@ escape_pipe:
escape_redir:
next2:
/* sub commands */
ptr = strchr (cmd, '`');
ptr = (char *)r_str_firstbut_escape (cmd, '`', "'");
if (ptr) {
if (ptr > cmd) {
char *ch = ptr - 1;
@ -3687,7 +3687,7 @@ next2:
oneline = 0;
empty = true;
}
ptr2 = strchr (ptr + 1, '`');
ptr2 = (char *)r_str_firstbut_escape (ptr + 1, '`', "'");
if (empty) {
/* do nothing */
} else if (!ptr2) {