From owner-svn-src-head@FreeBSD.ORG Sat Jun 22 02:57:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10211DEC; Sat, 22 Jun 2013 02:57:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD9B8175D; Sat, 22 Jun 2013 02:57:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5M2vqOS049068; Sat, 22 Jun 2013 02:57:52 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5M2vquh049066; Sat, 22 Jun 2013 02:57:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306220257.r5M2vquh049066@svn.freebsd.org> From: Devin Teske Date: Sat, 22 Jun 2013 02:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252083 - head/usr.sbin/bsdconfig/share/media 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.14 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: Sat, 22 Jun 2013 02:57:53 -0000 Author: dteske Date: Sat Jun 22 02:57:52 2013 New Revision: 252083 URL: http://svnweb.freebsd.org/changeset/base/252083 Log: Take advantage of the fact that f_getvar evaluates the $var_to_get parameter within braces, allowing all manner of parameter expansions (properly quoted or escaped, of course). Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/httpproxy.subr Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Sat Jun 22 02:51:22 2013 (r252082) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Sat Jun 22 02:57:52 2013 (r252083) @@ -853,11 +853,10 @@ f_media_get_ftp() userpass="$userpass${userpass:+@}" fi - local ftp_dir mode rx - f_getvar $VAR_FTP_DIR ftp_dir + local dir mode rx + f_getvar $VAR_FTP_DIR\#/ dir f_getvar $VAR_FTP_STATE mode - local dir="${ftp_dir#/}" local port="${ftp_port:+:$ftp_port}" case "$host" in *:*) host="[$host]"; esac Modified: head/usr.sbin/bsdconfig/share/media/httpproxy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/httpproxy.subr Sat Jun 22 02:51:22 2013 (r252082) +++ head/usr.sbin/bsdconfig/share/media/httpproxy.subr Sat Jun 22 02:57:52 2013 (r252083) @@ -292,7 +292,7 @@ f_media_init_http_proxy() ;; *) local fdir fp - f_getvar $VAR_FTP_PATH fp + f_getvar $VAR_FTP_PATH%/ fp for fdir in $FTP_DIRS; do setvar $VAR_HTTP_PROXY_PATH "$fp/$fdir/$rel" if f_http_proxy_check_access; then @@ -380,9 +380,9 @@ f_media_get_http_proxy() fi local proxy_path mode - f_getvar $VAR_HTTP_PROXY_PATH proxy_path + f_getvar $VAR_HTTP_PROXY_PATH%/ proxy_path f_getvar $VAR_HTTP_FTP_MODE mode - local url="${proxy_path%/}/$file$mode" rx + local url="$proxy_path/$file$mode" rx f_dprintf "sending http request for: %s" "$url" printf "GET %s HTTP/1.0\r\n\r\n" "$url" | nc -n "$host" "$proxy_port" |