nalika / rpms / bash

Forked from rpms/bash 2 years ago
Clone

Blame SOURCES/bash42-036

287226
			     BASH PATCH REPORT
287226
			     =================
287226
287226
Bash-Release:	4.2
287226
Patch-ID:	bash42-036
287226
287226
Bug-Reported-by:	gregrwm <backuppc-users@whitleymott.net>
287226
Bug-Reference-ID:	<CAD+dB9B4JG+qUwZBQUwiQmVt0j6NDn=DDTxr9R+nkA8DL4KLJA@mail.gmail.com>
287226
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-05/msg00108.html
287226
287226
Bug-Description:
287226
287226
Bash-4.2 produces incorrect word splitting results when expanding
287226
double-quoted $@ in the same string as and adjacent to other variable
287226
expansions.  The $@ should be split, the other expansions should not.
287226
287226
Patch (apply with `patch -p0'):
287226
287226
*** ../bash-4.2-patched/subst.c	2012-05-02 12:02:33.000000000 -0400
287226
--- subst.c	2012-07-08 21:19:32.000000000 -0400
287226
***************
287226
*** 7923,7927 ****
287226
    /* State flags */
287226
    int had_quoted_null;
287226
!   int has_dollar_at;
287226
    int tflag;
287226
    int pflags;			/* flags passed to param_expand */
287226
--- 7923,7927 ----
287226
    /* State flags */
287226
    int had_quoted_null;
287226
!   int has_dollar_at, temp_has_dollar_at;
287226
    int tflag;
287226
    int pflags;			/* flags passed to param_expand */
287226
***************
287226
*** 8128,8138 ****
287226
  	    *expanded_something = 1;
287226
  
287226
! 	  has_dollar_at = 0;
287226
  	  pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
287226
  	  if (word->flags & W_NOSPLIT2)
287226
  	    pflags |= PF_NOSPLIT2;
287226
  	  tword = param_expand (string, &sindex, quoted, expanded_something,
287226
! 			       &has_dollar_at, &quoted_dollar_at,
287226
  			       &had_quoted_null, pflags);
287226
  
287226
  	  if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal)
287226
--- 8128,8139 ----
287226
  	    *expanded_something = 1;
287226
  
287226
! 	  temp_has_dollar_at = 0;
287226
  	  pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
287226
  	  if (word->flags & W_NOSPLIT2)
287226
  	    pflags |= PF_NOSPLIT2;
287226
  	  tword = param_expand (string, &sindex, quoted, expanded_something,
287226
! 			       &temp_has_dollar_at, &quoted_dollar_at,
287226
  			       &had_quoted_null, pflags);
287226
+ 	  has_dollar_at += temp_has_dollar_at;
287226
  
287226
  	  if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal)
287226
***************
287226
*** 8275,8281 ****
287226
  	      temp = (char *)NULL;
287226
  
287226
! 	      has_dollar_at = 0;
287226
  	      /* Need to get W_HASQUOTEDNULL flag through this function. */
287226
! 	      list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &has_dollar_at, (int *)NULL);
287226
  
287226
  	      if (list == &expand_word_error || list == &expand_word_fatal)
287226
--- 8276,8283 ----
287226
  	      temp = (char *)NULL;
287226
  
287226
! 	      temp_has_dollar_at = 0;	/* XXX */
287226
  	      /* Need to get W_HASQUOTEDNULL flag through this function. */
287226
! 	      list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL);
287226
! 	      has_dollar_at += temp_has_dollar_at;
287226
  
287226
  	      if (list == &expand_word_error || list == &expand_word_fatal)
287226
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
287226
--- patchlevel.h	Thu Feb 24 21:41:34 2011
287226
***************
287226
*** 26,30 ****
287226
     looks for to find the patch level (for the sccs version string). */
287226
  
287226
! #define PATCHLEVEL 35
287226
  
287226
  #endif /* _PATCHLEVEL_H_ */
287226
--- 26,30 ----
287226
     looks for to find the patch level (for the sccs version string). */
287226
  
287226
! #define PATCHLEVEL 36
287226
  
287226
  #endif /* _PATCHLEVEL_H_ */