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