7 Bug-Reported-by: Ruediger Kuhlmann <RKuhlmann@orga-systems.com>
8 Bug-Reference-ID: <OFDE975207.0C3622E5-ONC12579F3.00361A06-C12579F3.00365E39@orga-systems.com>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-05/msg00010.html
13 Bash-4.2 has problems with DEL characters in the expanded value of variables
14 used in the same quoted string as variables that expand to nothing.
16 Patch (apply with `patch -p0'):
18 Index: b/bash/patchlevel.h
19 ===================================================================
20 --- a/bash/patchlevel.h
21 +++ b/bash/patchlevel.h
23 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
24 looks for to find the patch level (for the sccs version string). */
26 -#define PATCHLEVEL 31
27 +#define PATCHLEVEL 32
29 #endif /* _PATCHLEVEL_H_ */
31 ===================================================================
34 @@ -8151,6 +8151,14 @@
36 dispose_word_desc (tword);
38 + /* Kill quoted nulls; we will add them back at the end of
39 + expand_word_internal if nothing else in the string */
40 + if (had_quoted_null && temp && QUOTED_NULL (temp))
43 + temp = (char *)NULL;
50 tword->flags |= W_NOEXPAND; /* XXX */
51 if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
52 tword->flags |= W_QUOTED;
53 - if (had_quoted_null)
54 + if (had_quoted_null && QUOTED_NULL (istring))
55 tword->flags |= W_HASQUOTEDNULL;
56 list = make_word_list (tword, (WORD_LIST *)NULL);
59 tword->flags |= W_NOGLOB;
60 if (word->flags & W_NOEXPAND)
61 tword->flags |= W_NOEXPAND;
62 - if (had_quoted_null)
63 + if (had_quoted_null && QUOTED_NULL (istring))
64 tword->flags |= W_HASQUOTEDNULL; /* XXX */
65 list = make_word_list (tword, (WORD_LIST *)NULL);