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).
This commit is contained in:
Devin Teske 2013-06-22 02:57:52 +00:00
parent 4ef0123eb7
commit 2c2a50fde6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252083
2 changed files with 5 additions and 6 deletions

View file

@ -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

View file

@ -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" |