svn commit: r297937 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Wed Apr 13 20:32:36 UTC 2016


Author: jilles
Date: Wed Apr 13 20:32:35 2016
New Revision: 297937
URL: https://svnweb.freebsd.org/changeset/base/297937

Log:
  sh: Simplify code by removing variable bracketed_name.

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Wed Apr 13 20:15:49 2016	(r297936)
+++ head/bin/sh/parser.c	Wed Apr 13 20:32:35 2016	(r297937)
@@ -1616,7 +1616,6 @@ parsesub: {
 	int flags;
 	char *p;
 	static const char types[] = "}-+?=";
-	int bracketed_name = 0; /* used to handle ${[0-9]*} variables */
 	int linno;
 	int length;
 	int c1;
@@ -1640,7 +1639,6 @@ parsesub: {
 		subtype = VSNORMAL;
 		flags = 0;
 		if (c == '{') {
-			bracketed_name = 1;
 			c = pgetc_linecont();
 			subtype = 0;
 		}
@@ -1665,7 +1663,7 @@ varname:
 				flags |= VSLINENO;
 			}
 		} else if (is_digit(c)) {
-			if (bracketed_name) {
+			if (subtype != VSNORMAL) {
 				do {
 					STPUTC(c, out);
 					c = pgetc_linecont();


More information about the svn-src-all mailing list