From 2a2674499e7d41e2887de4e3e6c3acee1c43494e Mon Sep 17 00:00:00 2001 From: Devin Teske Date: Fri, 7 Mar 2014 20:18:39 +0000 Subject: [PATCH] Fix incorrect return status if var_to_set and var_to_get are the same. --- usr.sbin/bsdconfig/share/common.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr index 16533681be0e..aa044b603a4c 100644 --- a/usr.sbin/bsdconfig/share/common.subr +++ b/usr.sbin/bsdconfig/share/common.subr @@ -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"; }