7 Bug-Reported-by: Dan Douglas <ormaaj@gmail.com>
8 Bug-Reference-ID: <1498458.MpVlmOXDB7@smorgbox>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-09/msg00008.html
13 Under certain circumstances, bash attempts to expand variables in arithmetic
14 expressions even when evaluation is being suppressed.
16 Patch (apply with `patch -p0'):
18 *** ../bash-4.2-patched/expr.c 2011-11-21 18:03:35.000000000 -0500
19 --- expr.c 2012-09-09 16:31:18.000000000 -0400
25 + /*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/
26 + /* If we are suppressing evaluation, just short-circuit here instead of
27 + going through the rest of the evaluator. */
32 #if defined (ARRAY_VARS)
38 + /* XXX - watch out for pointer aliasing issues here */
39 + if (curlval.tokstr && curlval.tokstr == tokstr)
40 + init_lvalue (&curlval);
43 tokstr = savestring (tp);
44 *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
45 --- patchlevel.h Thu Feb 24 21:41:34 2011
48 looks for to find the patch level (for the sccs version string). */
50 ! #define PATCHLEVEL 38
52 #endif /* _PATCHLEVEL_H_ */
54 looks for to find the patch level (for the sccs version string). */
56 ! #define PATCHLEVEL 39
58 #endif /* _PATCHLEVEL_H_ */