07a490
			     BASH PATCH REPORT
07a490
			     =================
07a490
07a490
Bash-Release:	4.2
07a490
Patch-ID:	bash42-039
07a490
07a490
Bug-Reported-by:	Dan Douglas <ormaaj@gmail.com>
07a490
Bug-Reference-ID:	<1498458.MpVlmOXDB7@smorgbox>
07a490
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-09/msg00008.html
07a490
07a490
Bug-Description:
07a490
07a490
Under certain circumstances, bash attempts to expand variables in arithmetic
07a490
expressions even when evaluation is being suppressed.
07a490
07a490
Patch (apply with `patch -p0'):
07a490
07a490
*** ../bash-4.2-patched/expr.c	2011-11-21 18:03:35.000000000 -0500
07a490
--- expr.c	2012-09-09 16:31:18.000000000 -0400
07a490
***************
07a490
*** 1010,1013 ****
07a490
--- 1073,1082 ----
07a490
  #endif
07a490
  
07a490
+ /*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/
07a490
+   /* If we are suppressing evaluation, just short-circuit here instead of
07a490
+      going through the rest of the evaluator. */
07a490
+   if (noeval)
07a490
+     return (0);
07a490
+ 
07a490
    /* [[[[[ */
07a490
  #if defined (ARRAY_VARS)
07a490
***************
07a490
*** 1183,1186 ****
07a490
--- 1256,1263 ----
07a490
  
07a490
        *cp = '\0';
07a490
+       /* XXX - watch out for pointer aliasing issues here */
07a490
+       if (curlval.tokstr && curlval.tokstr == tokstr)
07a490
+ 	init_lvalue (&curlval);
07a490
+ 
07a490
        FREE (tokstr);
07a490
        tokstr = savestring (tp);
07a490
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
07a490
--- patchlevel.h	Thu Feb 24 21:41:34 2011
07a490
***************
07a490
*** 26,30 ****
07a490
     looks for to find the patch level (for the sccs version string). */
07a490
  
07a490
! #define PATCHLEVEL 38
07a490
  
07a490
  #endif /* _PATCHLEVEL_H_ */
07a490
--- 26,30 ----
07a490
     looks for to find the patch level (for the sccs version string). */
07a490
  
07a490
! #define PATCHLEVEL 39
07a490
  
07a490
  #endif /* _PATCHLEVEL_H_ */