rcolebaugh / rpms / bash

Forked from rpms/bash a year ago
Clone
287226
			     BASH PATCH REPORT
287226
			     =================
287226
287226
Bash-Release:	4.2
287226
Patch-ID:	bash42-001
287226
287226
Bug-Reported-by:	Juergen Daubert <jue@jue.li>
287226
Bug-Reference-ID:	<20110214175132.GA19813@jue.netz>
287226
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00125.html
287226
287226
Bug-Description:
287226
287226
When running in Posix mode, bash does not correctly expand the right-hand
287226
side of a double-quoted word expansion containing single quotes.
287226
287226
Patch (apply with `patch -p0'):
287226
287226
*** ../bash-4.2-patched/subst.c	2011-01-02 16:12:51.000000000 -0500
287226
--- subst.c	2011-02-19 00:00:00.000000000 -0500
287226
***************
287226
*** 1380,1387 ****
287226
  
287226
    /* The handling of dolbrace_state needs to agree with the code in parse.y:
287226
!      parse_matched_pair() */
287226
!   dolbrace_state = 0;
287226
!   if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
287226
!     dolbrace_state = (flags & SX_POSIXEXP) ? DOLBRACE_QUOTE : DOLBRACE_PARAM;
287226
  
287226
    i = *sindex;
287226
--- 1380,1389 ----
287226
  
287226
    /* The handling of dolbrace_state needs to agree with the code in parse.y:
287226
!      parse_matched_pair().  The different initial value is to handle the
287226
!      case where this function is called to parse the word in
287226
!      ${param op word} (SX_WORD). */
287226
!   dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM;
287226
!   if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP))
287226
!     dolbrace_state = DOLBRACE_QUOTE;
287226
  
287226
    i = *sindex;
287226
***************
287226
*** 7177,7181 ****
287226
        /* Extract the contents of the ${ ... } expansion
287226
  	 according to the Posix.2 rules. */
287226
!       value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#') ? SX_POSIXEXP : 0);
287226
        if (string[sindex] == RBRACE)
287226
  	sindex++;
287226
--- 7181,7185 ----
287226
        /* Extract the contents of the ${ ... } expansion
287226
  	 according to the Posix.2 rules. */
287226
!       value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD);
287226
        if (string[sindex] == RBRACE)
287226
  	sindex++;
287226
*** ../bash-4.2-patched/subst.h	2010-12-02 20:21:29.000000000 -0500
287226
--- subst.h	2011-02-16 21:12:09.000000000 -0500
287226
***************
287226
*** 57,60 ****
287226
--- 57,61 ----
287226
  #define SX_ARITHSUB	0x0080	/* extracting $(( ... )) (currently unused) */
287226
  #define SX_POSIXEXP	0x0100	/* extracting new Posix pattern removal expansions in extract_dollar_brace_string */
287226
+ #define SX_WORD		0x0200	/* extracting word in ${param op word} */
287226
  
287226
  /* Remove backslashes which are quoting backquotes from STRING.  Modifies
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 0
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 1
287226
  
287226
  #endif /* _PATCHLEVEL_H_ */