Date: Sun, 11 Apr 2010 12:24:47 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r206473 - head/bin/sh Message-ID: <201004111224.o3BCOl4j096038@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Sun Apr 11 12:24:47 2010 New Revision: 206473 URL: http://svn.freebsd.org/changeset/base/206473 Log: sh: Partially revert r206146, allowing double-quotes in arithmetic. These do pretty much nothing (except that parentheses are ignored), but people seem to use them and allowing them does not hurt much. Single-quotes seem not to be used and cause silently different behaviour with ksh93 character constants. Modified: head/bin/sh/mksyntax.c head/bin/sh/parser.c Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Sun Apr 11 12:07:03 2010 (r206472) +++ head/bin/sh/mksyntax.c Sun Apr 11 12:24:47 2010 (r206473) @@ -232,6 +232,7 @@ main(int argc __unused, char **argv __un add("\n", "CNL"); add("\\", "CBACK"); add("`", "CBQUOTE"); + add("\"", "CDQUOTE"); add("$", "CVAR"); add("}", "CENDVAR"); add("(", "CLP"); Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Apr 11 12:07:03 2010 (r206472) +++ head/bin/sh/parser.c Sun Apr 11 12:24:47 2010 (r206473) @@ -1223,7 +1223,10 @@ readtoken1(int firstc, char const *initi if (eofmark != NULL && newvarnest == 0) USTPUTC(c, out); else { - state[level].syntax = BASESYNTAX; + if (state[level].category == TSTATE_ARITH) + state[level].syntax = ARISYNTAX; + else + state[level].syntax = BASESYNTAX; quotef++; } break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004111224.o3BCOl4j096038>