svashisht / rpms / bash

Forked from rpms/bash 4 years ago
Clone

Blame SOURCES/bash42-001

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