Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Mar 2014 20:18:40 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262898 - head/usr.sbin/bsdconfig/share
Message-ID:  <201403072018.s27KIeOp026992@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Fri Mar  7 20:18:39 2014
New Revision: 262898
URL: http://svnweb.freebsd.org/changeset/base/262898

Log:
  Fix incorrect return status if var_to_set and var_to_get are the same.

Modified:
  head/usr.sbin/bsdconfig/share/common.subr

Modified: head/usr.sbin/bsdconfig/share/common.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/common.subr	Fri Mar  7 20:15:52 2014	(r262897)
+++ head/usr.sbin/bsdconfig/share/common.subr	Fri Mar  7 20:18:39 2014	(r262898)
@@ -270,9 +270,9 @@ f_getvar()
 {
 	local __var_to_get="$1" __var_to_set="$2"
 	[ "$__var_to_set" ] || local value
-	eval ${__var_to_set:-value}=\"\${$__var_to_get}\"
 	eval [ \"\${$__var_to_get+set}\" ]
 	local __retval=$?
+	eval ${__var_to_set:-value}=\"\${$__var_to_get}\"
 	eval f_dprintf '"f_getvar: var=[%s] value=[%s] r=%u"' \
 		\"\$__var_to_get\" \"\$${__var_to_set:-value}\" \$__retval
 	[ "$__var_to_set" ] || { [ "$value" ] && echo "$value"; }



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