Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2016 20:32:35 +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: r297937 - head/bin/sh
Message-ID:  <201604132032.u3DKWZPN084646@repo.freebsd.org>

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



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