diff --git a/src/expansion/expansion.c b/src/expansion/expansion.c index ab6241e..4fea985 100644 --- a/src/expansion/expansion.c +++ b/src/expansion/expansion.c @@ -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