feat(expansion): remove double quotes
This commit is contained in:
parent
ed64a1bc18
commit
308ac9ac8d
1 changed files with 7 additions and 1 deletions
|
|
@ -135,7 +135,7 @@ bool expand(struct ast_command *command, const struct hash_map *vars)
|
||||||
{
|
{
|
||||||
if (str[i] == '\'')
|
if (str[i] == '\'')
|
||||||
{
|
{
|
||||||
// remove quote
|
// remove single quote
|
||||||
in_quotes = !in_quotes;
|
in_quotes = !in_quotes;
|
||||||
memmove(str + i, str + i + 1, strlen(str + i + 1) + 1);
|
memmove(str + i, str + i + 1, strlen(str + i + 1) + 1);
|
||||||
i--;
|
i--;
|
||||||
|
|
@ -144,6 +144,12 @@ bool expand(struct ast_command *command, const struct hash_map *vars)
|
||||||
{
|
{
|
||||||
continue; // do nothing
|
continue; // do nothing
|
||||||
}
|
}
|
||||||
|
else if (str[i] == '\"')
|
||||||
|
{
|
||||||
|
// remove double quote
|
||||||
|
memmove(str + i, str + i + 1, strlen(str + i + 1) + 1);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
else if (str[i] == '$' && str[i + 1] != 0 && !isspace(str[i + 1]))
|
else if (str[i] == '$' && str[i + 1] != 0 && !isspace(str[i + 1]))
|
||||||
{
|
{
|
||||||
// variable expansion
|
// variable expansion
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue