putwww: fix filename quoting

This commit is contained in:
tastytea 2023-11-12 22:06:42 +01:00
parent 2d2ec24d28
commit 21ff36312e
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM

View File

@ -13,16 +13,16 @@ if [[ ${#o_help} -ne 0 || ! -v 1 ]]; then
return ${ret} return ${ret}
fi fi
local dir="" local dir=""
[[ -n ${o_dir[2]} ]] && dir=${o_dir[2]}/ [[ -n ${o_dir[2]} ]] && dir=${(q)o_dir[2]}/
local -a putcmds local -a putcmds
for file in "${@}"; do for file in ${@}; do
putcmds+="put ${file}" putcmds+="put ${(q)file}"
done done
sftp tastytea.de <<EOF sftp tastytea.de <<EOF
cd /var/www/tastytea.de/files/${dir} cd /var/www/tastytea.de/files/${dir}
$(print -l ${putcmds}) $(print -l ${(q)putcmds})
EOF EOF
for file in "${@}"; do for file in "${@}"; do