From owner-svn-src-head@freebsd.org Tue Sep 1 21:48:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F9D49C8ECB; Tue, 1 Sep 2015 21:48:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1094A1852; Tue, 1 Sep 2015 21:48:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t81LmM0H023245; Tue, 1 Sep 2015 21:48:22 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t81LmM9I023244; Tue, 1 Sep 2015 21:48:22 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509012148.t81LmM9I023244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 1 Sep 2015 21:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287383 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2015 21:48:23 -0000 Author: dteske Date: Tue Sep 1 21:48:22 2015 New Revision: 287383 URL: https://svnweb.freebsd.org/changeset/base/287383 Log: Comment for escape() function. MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Tue Sep 1 21:42:00 2015 (r287382) +++ head/usr.sbin/sysrc/sysrc Tue Sep 1 21:48:22 2015 (r287383) @@ -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=