Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 2017 16:09:30 +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: r315487 - head/bin/sh
Message-ID:  <201703181609.v2IG9UPt011798@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sat Mar 18 16:09:30 2017
New Revision: 315487
URL: https://svnweb.freebsd.org/changeset/base/315487

Log:
  sh: Remove unused return value of subevalvar_misc().

Modified:
  head/bin/sh/expand.c

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Sat Mar 18 16:07:28 2017	(r315486)
+++ head/bin/sh/expand.c	Sat Mar 18 16:09:30 2017	(r315487)
@@ -97,7 +97,7 @@ static const char *expari(const char *, 
     struct worddest *);
 static void expbackq(union node *, int, int, struct worddest *);
 static void subevalvar_trim(const char *, struct nodelist *, int, int, int);
-static int subevalvar_misc(const char *, struct nodelist *, const char *, int,
+static void subevalvar_misc(const char *, struct nodelist *, const char *, int,
     int, int);
 static const char *evalvar(const char *, struct nodelist **restrict, int,
     struct worddest *);
@@ -617,7 +617,7 @@ subevalvar_trim(const char *p, struct no
 }
 
 
-static int
+static void
 subevalvar_misc(const char *p, struct nodelist *argbackq, const char *var, int subtype, int startloc,
   int varflags)
 {
@@ -634,7 +634,7 @@ subevalvar_misc(const char *p, struct no
 		setvar(var, startp, 0);
 		amount = startp - expdest;
 		STADJUST(amount, expdest);
-		return 1;
+		return;
 
 	case VSQUESTION:
 		if (*p != CTLENDVAR) {
@@ -643,7 +643,6 @@ subevalvar_misc(const char *p, struct no
 		}
 		error("%.*s: parameter %snot set", (int)(p - var - 1),
 		      var, (varflags & VSNUL) ? "null or " : "");
-		return 0;
 
 	default:
 		abort();
@@ -792,12 +791,11 @@ again: /* jump here after setting a vari
 	case VSASSIGN:
 	case VSQUESTION:
 		if (!set) {
-			if (subevalvar_misc(p, *argbackq, var, subtype,
-			    startloc, varflags)) {
-				varflags &= ~VSNUL;
-				goto again;
-			}
-			break;
+			subevalvar_misc(p, *argbackq, var, subtype,
+			    startloc, varflags);
+			/* assert(subtype == VSASSIGN); */
+			varflags &= ~VSNUL;
+			goto again;
 		}
 		break;
 



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