From 5164504a9ea522a54309414ea6166d96108553e1 Mon Sep 17 00:00:00 2001 From: Devin Teske Date: Sun, 17 Jun 2018 06:25:32 +0000 Subject: [PATCH] sysrc.subr: Fix display when value is "-n" PR: bin/226406 Reported by: Marius Halden MFC after: 1 week X-MFC-to: stable/11 Sponsored by: Smule, Inc. --- usr.sbin/bsdconfig/share/sysrc.subr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdconfig/share/sysrc.subr b/usr.sbin/bsdconfig/share/sysrc.subr index 4d27c2047c7d..4d8ec0a03f1a 100644 --- a/usr.sbin/bsdconfig/share/sysrc.subr +++ b/usr.sbin/bsdconfig/share/sysrc.subr @@ -200,7 +200,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null ) } @@ -338,7 +338,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null ) }