Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Sep 2012 03:41:22 +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: r241042 - head/usr.sbin/bsdconfig/share
Message-ID:  <201209290341.q8T3fM7v055817@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Sat Sep 29 03:41:21 2012
New Revision: 241042
URL: http://svn.freebsd.org/changeset/base/241042

Log:
  Allow deferred word-splitting via f_sysrc_get() by allowing $IFS in the
  "clean-room" environment used to query rc.conf(5) parameters.
  
  This brings bsdconfig(8)'s sysrc.subr in-line with both the sysrc(8) manual
  [provided by sysutils/sysrc] and sysrc(8)'s own sysrc.subr (now identical to
  bsdconfig(8)'s sysrc.subr as of this patch).
  
  Finally, this will allow a clean import of sysutils/sysrc (sans sysrc.subr,
  already provided here).
  
  Reviewed by:	jilles
  Approved by:	adrian (co-mentor)

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

Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/sysrc.subr	Sat Sep 29 01:15:45 2012	(r241041)
+++ head/usr.sbin/bsdconfig/share/sysrc.subr	Sat Sep 29 03:41:21 2012	(r241042)
@@ -143,7 +143,7 @@ f_sysrc_get()
 		# Clear the environment of all variables, preventing the
 		# expansion of normals such as `PS1', `TERM', etc.
 		#
-		f_clean_env --except RC_CONFS RC_DEFAULTS
+		f_clean_env --except IFS RC_CONFS RC_DEFAULTS
 
 		. "$RC_DEFAULTS" > /dev/null 2>&1
 
@@ -451,8 +451,7 @@ f_sysrc_set()
 		if [ "${RC_CONFS+set}" ]; then
 			file="${RC_CONFS%%[$IFS]*}"
 		else
-			file=$( f_sysrc_get rc_conf_files )
-			file="${file%%[$IFS]*}"
+			file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' )
 		fi
 	fi
 



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