diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-04 16:07:40 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-04 19:39:07 -0500 |
commit | 5f97f7885b8bdb7a6fea34d6d073428b199d66ef (patch) | |
tree | 735d170db75f954f80cbae7bb8aa43fe964f0857 /src | |
parent | 403b4f20e5cfd2d2c0348de076effd3ddb616844 (diff) |
librefetch: fiddle with DOWNLOADER percent-substitution
Diffstat (limited to 'src')
-rwxr-xr-x | src/librefetch/librefetch | 6 |
1 files changed, 4 insertions, 2 deletions
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 |