chiark / gitweb /
Disable all exported shell functions
[bash.git] / debian / patches / bash42-028.diff
1                              BASH PATCH REPORT
2                              =================
3
4 Bash-Release:   4.2
5 Patch-ID:       bash42-028
6
7 Bug-Reported-by:        Mark Edgar <medgar123@gmail.com>
8 Bug-Reference-ID:       <CABHMh_3d+ZgO_zaEtYXPwK4P7tC0ghZ4g=Ue_TRpsEMf5YDsqw@mail.gmail.com>
9 Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00109.html
10
11 Bug-Description:
12
13 When using a word expansion for which the right hand side is evaluated,
14 certain expansions of quoted null strings include spurious ^? characters.
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 27
27 +#define PATCHLEVEL 28
28  
29  #endif /* _PATCHLEVEL_H_ */
30 Index: b/bash/subst.c
31 ===================================================================
32 --- a/bash/subst.c
33 +++ b/bash/subst.c
34 @@ -5809,6 +5809,16 @@
35          is the only expansion that creates more than one word. */
36        if (qdollaratp && ((hasdol && quoted) || l->next))
37         *qdollaratp = 1;
38 +      /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is
39 +        a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the
40 +        flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the
41 +        expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
42 +        (which is more paranoia than anything else), we need to return the
43 +        quoted null string and set the flags to indicate it. */
44 +      if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL(temp) && QUOTED_NULL(l->word->word) && (l->word->flags & W_HASQUOTEDNULL))
45 +       {
46 +         w->flags |= W_HASQUOTEDNULL;
47 +       }
48        dispose_words (l);
49      }
50    else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol)