summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-09-29 03:41:21 +0000
committerdteske <dteske@FreeBSD.org>2012-09-29 03:41:21 +0000
commite094bc67f532bc4f9b7a97479288f80cab564f2e (patch)
tree63856e8493a22a886f3cd919ef55d7c80eb19e80
parent5c64acd0e79bf2fed24d54bd269f42c18ce19f53 (diff)
downloadFreeBSD-src-e094bc67f532bc4f9b7a97479288f80cab564f2e.zip
FreeBSD-src-e094bc67f532bc4f9b7a97479288f80cab564f2e.tar.gz
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)
-rw-r--r--usr.sbin/bsdconfig/share/sysrc.subr5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/bsdconfig/share/sysrc.subr b/usr.sbin/bsdconfig/share/sysrc.subr
index f8824a8..ca47067 100644
--- a/usr.sbin/bsdconfig/share/sysrc.subr
+++ b/usr.sbin/bsdconfig/share/sysrc.subr
@@ -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
OpenPOWER on IntegriCloud