Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2012 20:52:21 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r234001 - stable/8/bin/sh
Message-ID:  <201204072052.q37KqLCe078041@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204072052.q37KqLCe078041>