nsh/nsh_parse: Fix handling of back-quotes

The logic that handles back-quotes was faulty, i.e. example command
set FOO `ls -l` would be split into two tokens as follows:
- set FOO `ls
- -l`

This results in nsh: `: no matching ` error, this fixes that issue.
This commit is contained in:
Ville Juven 2023-04-04 13:42:59 +03:00 committed by Xiang Xiao
parent 700b0ed235
commit 4ce809e7d4

View File

@ -1826,7 +1826,13 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl,
/* Is it a back-quote ? These are not removed here */
if (*pend != '`')
if (*pend == '`')
{
/* Yes, keep the quotes in place */
pend = qend;
}
else
{
/* No, get rid of the single / double quotes here */