diff options
author | dteske <dteske@FreeBSD.org> | 2012-09-29 03:41:21 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2012-09-29 03:41:21 +0000 |
commit | e094bc67f532bc4f9b7a97479288f80cab564f2e (patch) | |
tree | 63856e8493a22a886f3cd919ef55d7c80eb19e80 /usr.sbin/bsdconfig/share/sysrc.subr | |
parent | 5c64acd0e79bf2fed24d54bd269f42c18ce19f53 (diff) | |
download | FreeBSD-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)
Diffstat (limited to 'usr.sbin/bsdconfig/share/sysrc.subr')
-rw-r--r-- | usr.sbin/bsdconfig/share/sysrc.subr | 5 |
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 |