svn commit: r234001 - stable/8/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sat Apr 7 20:52:22 UTC 2012


Author: jilles
Date: Sat Apr  7 20:52:21 2012
New Revision: 234001
URL: http://svn.freebsd.org/changeset/base/234001

Log:
  sh: Allow variables starting with underscores in arithmetic.
  
  This is a direct commit because I do not want to merge the totally rewritten
  arithmetic expression code from 9.x where this already works.
  
  Example:
    _x=1; _x=$((_x+1))

Modified:
  stable/8/bin/sh/arith_lex.l

Modified: stable/8/bin/sh/arith_lex.l
==============================================================================
--- stable/8/bin/sh/arith_lex.l	Sat Apr  7 15:30:46 2012	(r234000)
+++ stable/8/bin/sh/arith_lex.l	Sat Apr  7 20:52:21 2012	(r234001)
@@ -90,7 +90,7 @@ static struct varname *varnames;
 			return ARITH_NUM;
 		}
 
-[A-Za-z][A-Za-z0-9_]*	{
+[A-Za-z_][A-Za-z0-9_]*	{
 			/*
 			 * If variable doesn't exist, we should initialize
 			 * it to zero.


More information about the svn-src-stable-8 mailing list