From 5f97f7885b8bdb7a6fea34d6d073428b199d66ef Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jan 2014 16:07:40 -0500 Subject: librefetch: fiddle with DOWNLOADER percent-substitution --- src/librefetch/librefetch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/librefetch/librefetch') diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 61fc3ad..a477315 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -151,8 +151,10 @@ main() { fi local dlcmd="${DOWNLOADER}" - dlcmd="${dlcmd//\%o/\"$dst\"}" - dlcmd="${dlcmd//\%u/\"$src\"}" + [[ $dlcmd = *%u* ]] || dlcmd="$dlcmd %u" + dlcmd="${dlcmd//\%o/$(printf '%q' "$dst")}" + dlcmd="${dlcmd//\%u/$(printf '%q' "$src")}" + { eval "$dlcmd"; } >> /dev/stderr && return 0 fi -- cgit v1.2.2