summaryrefslogtreecommitdiff
path: root/package/bash/bash-4.2-028.patch
blob: 28dfc71d59e2dabc8be462d6635cba9f17ca0a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
			     BASH PATCH REPORT
			     =================

Bash-Release:	4.2
Patch-ID:	bash42-028

Bug-Reported-by:	Mark Edgar <medgar123@gmail.com>
Bug-Reference-ID:	<CABHMh_3d+ZgO_zaEtYXPwK4P7tC0ghZ4g=Ue_TRpsEMf5YDsqw@mail.gmail.com>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00109.html

Bug-Description:

When using a word expansion for which the right hand side is evaluated,
certain expansions of quoted null strings include spurious ^? characters.

Patch (apply with `patch -p0'):

*** ../bash-4.2-patched/subst.c	2012-03-11 17:35:13.000000000 -0400
--- ./subst.c	2012-03-20 19:30:13.000000000 -0400
***************
*** 5810,5813 ****
--- 5810,5823 ----
        if (qdollaratp && ((hasdol && quoted) || l->next))
  	*qdollaratp = 1;
+       /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is
+ 	 a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the
+ 	 flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the
+ 	 expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
+ 	 (which is more paranoia than anything else), we need to return the
+ 	 quoted null string and set the flags to indicate it. */
+       if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL(temp) && QUOTED_NULL(l->word->word) && (l->word->flags & W_HASQUOTEDNULL))
+ 	{
+ 	  w->flags |= W_HASQUOTEDNULL;
+ 	}
        dispose_words (l);
      }

*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
--- ./patchlevel.h	Thu Feb 24 21:41:34 2011
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 27
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 28
  
  #endif /* _PATCHLEVEL_H_ */