From 7abb307c50e0e12d50eee3373c23acb75ff885e4 Mon Sep 17 00:00:00 2001 From: Devin Teske <dteske@FreeBSD.org> Date: Tue, 1 Sep 2015 21:48:22 +0000 Subject: [PATCH] Comment for escape() function. MFC after: 3 days X-MFC-to: stable/10 --- usr.sbin/sysrc/sysrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/usr.sbin/sysrc/sysrc b/usr.sbin/sysrc/sysrc index 2493cfb394f6..27d5a42efd9a 100644 --- a/usr.sbin/sysrc/sysrc +++ b/usr.sbin/sysrc/sysrc @@ -195,6 +195,14 @@ jail_depend() cat $BSDCFG_SHARE/sysrc.subr } +# escape $string [$var_to_set] +# +# Escape $string contents so that the contents can be properly encapsulated in +# single-quotes (making for safe evaluation). +# +# NB: See `bsdconfig includes -dF escape' for relevant information/discussion. +# NB: Abridged version of `f_shell_escape()' from bsdconfig(8) `strings.subr'. +# escape() { local __start="$1" __var_to_set="$2" __string=