462fb2
			     BASH PATCH REPORT
462fb2
			     =================
462fb2
462fb2
Bash-Release:	4.2
462fb2
Patch-ID:	bash42-046
462fb2
462fb2
Bug-Reported-by:	"Theodoros V. Kalamatianos" <thkala@gmail.com>
462fb2
Bug-Reference-ID:	<20140112011131.GE17667@infinity.metashade.com>
462fb2
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-01/msg00044.html
462fb2
462fb2
Bug-Description:
462fb2
462fb2
Bash-4.2 patch 32 introduced a problem with "$@" and arrays expanding empty
462fb2
positional parameters or array elements when using substring expansion,
462fb2
pattern substitution, or case modfication.  The empty parameters or array
462fb2
elements are removed instead of expanding to empty strings ("").
462fb2
462fb2
Patch (apply with `patch -p0'):
462fb2
462fb2
*** ../bash-4.2-patched/subst.c	2012-12-31 11:52:56.000000000 -0500
462fb2
--- subst.c	2014-03-31 14:19:56.000000000 -0400
462fb2
***************
462fb2
*** 7243,7247 ****
462fb2
        ret = alloc_word_desc ();
462fb2
        ret->word = temp1;
462fb2
!       if (temp1 && QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
462fb2
  	ret->flags |= W_QUOTED|W_HASQUOTEDNULL;
462fb2
        return ret;
462fb2
--- 7243,7253 ----
462fb2
        ret = alloc_word_desc ();
462fb2
        ret->word = temp1;
462fb2
!       /* We test quoted_dollar_atp because we want variants with double-quoted
462fb2
! 	 "$@" to take a different code path. In fact, we make sure at the end
462fb2
! 	 of expand_word_internal that we're only looking at these flags if
462fb2
! 	 quoted_dollar_at == 0. */
462fb2
!       if (temp1 && 
462fb2
!           (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) &&
462fb2
! 	  QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
462fb2
  	ret->flags |= W_QUOTED|W_HASQUOTEDNULL;
462fb2
        return ret;
462fb2
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
462fb2
--- patchlevel.h	Thu Feb 24 21:41:34 2011
462fb2
***************
462fb2
*** 26,30 ****
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 45
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */
462fb2
--- 26,30 ----
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 46
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */