Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2018 06:25:32 +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: r335281 - head/usr.sbin/bsdconfig/share
Message-ID:  <201806170625.w5H6PWXQ086447@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Sun Jun 17 06:25:32 2018
New Revision: 335281
URL: https://svnweb.freebsd.org/changeset/base/335281

Log:
  sysrc.subr: Fix display when value is "-n"
  
  PR:		bin/226406
  Reported by:	Marius Halden <marius.halden@modirum.com>
  MFC after:	1 week
  X-MFC-to:	stable/11
  Sponsored by:	Smule, Inc.

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

Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/sysrc.subr	Sun Jun 17 06:03:48 2018	(r335280)
+++ head/usr.sbin/bsdconfig/share/sysrc.subr	Sun Jun 17 06:25:32 2018	(r335281)
@@ -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
 	)
 }
 



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