svn commit: r206146 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sat Apr 3 21:01:01 UTC 2010


Author: jilles
Date: Sat Apr  3 21:01:01 2010
New Revision: 206146
URL: http://svn.freebsd.org/changeset/base/206146

Log:
  sh: Remove special handling for ' and " in arithmetic.
  They will be treated like normal characters, resulting in a runtime
  arithmetic expression error.
  
  Exp-run done by: erwin (with some other sh(1) changes)

Modified:
  head/bin/sh/mksyntax.c
  head/bin/sh/parser.c

Modified: head/bin/sh/mksyntax.c
==============================================================================
--- head/bin/sh/mksyntax.c	Sat Apr  3 20:55:56 2010	(r206145)
+++ head/bin/sh/mksyntax.c	Sat Apr  3 21:01:01 2010	(r206146)
@@ -232,8 +232,6 @@ main(int argc __unused, char **argv __un
 	add("\n", "CNL");
 	add("\\", "CBACK");
 	add("`", "CBQUOTE");
-	add("'", "CSQUOTE");
-	add("\"", "CDQUOTE");
 	add("$", "CVAR");
 	add("}", "CENDVAR");
 	add("(", "CLP");

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Sat Apr  3 20:55:56 2010	(r206145)
+++ head/bin/sh/parser.c	Sat Apr  3 21:01:01 2010	(r206146)
@@ -1223,10 +1223,7 @@ readtoken1(int firstc, char const *initi
 				if (eofmark != NULL && newvarnest == 0)
 					USTPUTC(c, out);
 				else {
-					if (state[level].category == TSTATE_ARITH)
-						state[level].syntax = ARISYNTAX;
-					else
-						state[level].syntax = BASESYNTAX;
+					state[level].syntax = BASESYNTAX;
 					quotef++;
 				}
 				break;


More information about the svn-src-all mailing list