chiark / gitweb /
Disable all exported shell functions
[bash.git] / debian / patches / bash42-032.diff
1                              BASH PATCH REPORT
2                              =================
3
4 Bash-Release:   4.2
5 Patch-ID:       bash42-032
6
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
10
11 Bug-Description:
12
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.
15
16 Patch (apply with `patch -p0'):
17
18 Index: b/bash/patchlevel.h
19 ===================================================================
20 --- a/bash/patchlevel.h
21 +++ b/bash/patchlevel.h
22 @@ -25,6 +25,6 @@
23     regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
24     looks for to find the patch level (for the sccs version string). */
25  
26 -#define PATCHLEVEL 31
27 +#define PATCHLEVEL 32
28  
29  #endif /* _PATCHLEVEL_H_ */
30 Index: b/bash/subst.c
31 ===================================================================
32 --- a/bash/subst.c
33 +++ b/bash/subst.c
34 @@ -8151,6 +8151,14 @@
35           temp = tword->word;
36           dispose_word_desc (tword);
37  
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))
41 +           {
42 +             FREE (temp);
43 +             temp = (char *)NULL;
44 +           }
45 +
46           goto add_string;
47           break;
48  
49 @@ -8555,7 +8563,7 @@
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);
57      }
58 @@ -8586,7 +8594,7 @@
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);
66         }