diff options
-rw-r--r-- | shell/hush.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/shell/hush.c b/shell/hush.c index df1b046ab..6c47be885 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -3840,21 +3840,6 @@ static int done_word(o_string *word, struct parse_context *ctx) | |||
3840 | word->o_assignment = MAYBE_ASSIGNMENT; | 3840 | word->o_assignment = MAYBE_ASSIGNMENT; |
3841 | } | 3841 | } |
3842 | debug_printf_parse("word->o_assignment='%s'\n", assignment_flag[word->o_assignment]); | 3842 | debug_printf_parse("word->o_assignment='%s'\n", assignment_flag[word->o_assignment]); |
3843 | |||
3844 | if (word->has_quoted_part | ||
3845 | /* optimization: and if it's ("" or '') or ($v... or `cmd`...): */ | ||
3846 | && (word->data[0] == '\0' || word->data[0] == SPECIAL_VAR_SYMBOL) | ||
3847 | /* (otherwise it's known to be not empty and is already safe) */ | ||
3848 | ) { | ||
3849 | /* exclude "$@" - it can expand to no word despite "" */ | ||
3850 | char *p = word->data; | ||
3851 | while (p[0] == SPECIAL_VAR_SYMBOL | ||
3852 | && (p[1] & 0x7f) == '@' | ||
3853 | && p[2] == SPECIAL_VAR_SYMBOL | ||
3854 | ) { | ||
3855 | p += 3; | ||
3856 | } | ||
3857 | } | ||
3858 | command->argv = add_string_to_strings(command->argv, xstrdup(word->data)); | 3843 | command->argv = add_string_to_strings(command->argv, xstrdup(word->data)); |
3859 | debug_print_strings("word appended to argv", command->argv); | 3844 | debug_print_strings("word appended to argv", command->argv); |
3860 | } | 3845 | } |