summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-01-04 16:07:40 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-01-04 19:39:07 -0500
commit5f97f7885b8bdb7a6fea34d6d073428b199d66ef (patch)
tree735d170db75f954f80cbae7bb8aa43fe964f0857
parent403b4f20e5cfd2d2c0348de076effd3ddb616844 (diff)
librefetch: fiddle with DOWNLOADER percent-substitution
-rwxr-xr-xsrc/librefetch/librefetch6
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