feat(expansion): remove double quotes
This commit is contained in:
parent
28b2e82078
commit
75d417eecf
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] == '\'')
|
||||
{
|
||||
// remove quote
|
||||
// remove single quote
|
||||
in_quotes = !in_quotes;
|
||||
memmove(str + i, str + i + 1, strlen(str + i + 1) + 1);
|
||||
i--;
|
||||
|
|
@ -144,6 +144,12 @@ bool expand(struct ast_command *command, const struct hash_map *vars)
|
|||
{
|
||||
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]))
|
||||
{
|
||||
// variable expansion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue