diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 13:52:48 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 13:52:48 -0500 |
commit | bc7bed50995cf3500a3595ae353ad7e57ca8f755 (patch) | |
tree | c9cf5a1a58b1831f0f125115f6a382e1fb88be0a /subst.c | |
parent | 7027abcba9628e4c4db779a54e8a4dfc8eb1a668 (diff) | |
download | bash-bc7bed50995cf3500a3595ae353ad7e57ca8f755.tar.gz |
commit bash-20051027 snapshot
Diffstat (limited to 'subst.c')
-rw-r--r-- | subst.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -6839,12 +6839,16 @@ add_string: { t_index = sindex++; - if (expanded_something) - *expanded_something = 1; - temp = string_extract (string, &sindex, "`", EX_REQMATCH); + /* The test of sindex against t_index is to allow bare instances of + ` to pass through, for backwards compatibility. */ if (temp == &extract_string_error || temp == &extract_string_fatal) { + if (sindex - 1 == t_index) + { + sindex = t_index; + goto add_character; + } report_error ("bad substitution: no closing \"`\" in %s", string+t_index); free (string); free (istring); @@ -6852,6 +6856,9 @@ add_string: : &expand_word_fatal); } + if (expanded_something) + *expanded_something = 1; + if (word->flags & W_NOCOMSUB) /* sindex + 1 because string[sindex] == '`' */ temp1 = substring (string, t_index, sindex + 1); |