diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 12:55:17 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 12:55:17 -0500 |
commit | 5ba8ff6eaac36dcbeea0c8af57632ec6432386a4 (patch) | |
tree | b61860f25e6788a411ae0b976e744ecc077e6f15 | |
parent | 5565fb1a355c9e89e6a6c9432e4dd40dc9d10013 (diff) | |
download | bash-5ba8ff6eaac36dcbeea0c8af57632ec6432386a4.tar.gz |
commit bash-20040304 snapshot
-rw-r--r-- | CWRU/CWRU.chlog | 10 | ||||
-rw-r--r-- | subst.c | 25 |
2 files changed, 25 insertions, 10 deletions
diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 417be316..838baed0 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -9218,7 +9218,7 @@ expr.c - make the exponentiation operator (**) associative, so things like 2**3**4 work right (change `if' to `while') - 3/2 + 3/3 --- lib/sh/strftime.c - SCO Unix 3.2, like Solaris, requires that the system's `timezone' @@ -9226,3 +9226,11 @@ lib/sh/strftime.c lib/readline/{bind,histfile,input,parens}.c - changes for Tandem (including `floss.h' (?)) + + 3/4 + --- +subst.c + - change param_expand to quote the entire expanded string instead + of just the escape characters if the expansion appears between + double quotes or in a here-document (for simple variable expansions + or expansions of positional parameters) @@ -5736,7 +5736,16 @@ param_expand (string, sindex, quoted, expanded_something, last_command_exit_value = EXECUTION_FAILURE; return (interactive_shell ? &expand_param_error : &expand_param_fatal); } +#if 1 + if (temp1) + temp = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (temp1) + : quote_escapes (temp1); + else + temp = (char *)NULL; +#else temp = temp1 ? quote_escapes (temp1) : (char *)NULL; +#endif break; /* $$ -- pid of the invoking shell. */ @@ -5827,17 +5836,10 @@ param_expand (string, sindex, quoted, expanded_something, string might need it (consider "\"$@\""), but we need some way to signal that the final split on the first character of $IFS should be done, even though QUOTED is 1. */ -#if 0 -if (list && list->next) - { -#endif if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) *quoted_dollar_at_p = 1; if (contains_dollar_at) *contains_dollar_at = 1; -#if 0 - } -#endif /* We want to separate the positional parameters with the first character of $IFS in case $IFS is something other than a space. @@ -5980,13 +5982,18 @@ comsub: { temp = array_reference (array_cell (var), 0); if (temp) - temp = quote_escapes (temp); + temp = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (temp) + : quote_escapes (temp); else if (unbound_vars_is_error) goto unbound_variable; } else #endif - temp = quote_escapes (value_cell (var)); + + temp = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (value_cell (var)) + : quote_escapes (value_cell (var)); free (temp1); goto return0; |