fix for interactive shell parser reset issue; fix for nested array subscript quoting issue; fix for process substitutions being closed to early in for loops

This commit is contained in:
Chet Ramey
2022-10-24 10:09:52 -04:00
parent 5d423d8ab3
commit 6711d2dc77
8 changed files with 56 additions and 18 deletions
+5 -1
View File
@@ -3824,6 +3824,10 @@ pos_params (string, start, end, quoted, pflags)
#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~')
#endif
/* We don't perform process substitution in arithmetic expressions, so don't
bother checking for it. */
#define ARITH_EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~')
/* If there are any characters in STRING that require full expansion,
then call FUNC to expand STRING; otherwise just perform quote
removal if necessary. This returns a new string. */
@@ -4033,7 +4037,7 @@ expand_arith_string (string, quoted)
i = saw_quote = 0;
while (string[i])
{
if (EXP_CHAR (string[i]))
if (ARITH_EXP_CHAR (string[i]))
break;
else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"')
saw_quote = string[i];