summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Ørsted Andresen <zlin@exherbo.org>2016-07-18 19:57:52 +0200
committerBo Ørsted Andresen <zlin@exherbo.org>2016-07-18 20:06:42 +0200
commit705ca0c89b7b41caa4ab149823406f56fc803b9a (patch)
tree2a6b862d7dcb8917127c993827b981496f443e00
parentc1642348ba28ccffaecd9a2c53bf8304e9ad3584 (diff)
downloadwgetpaste-705ca0c89b7b41caa4ab149823406f56fc803b9a.tar.gz
Don't quote empty parameter.
-rwxr-xr-xwgetpaste8
1 files changed, 4 insertions, 4 deletions
diff --git a/wgetpaste b/wgetpaste
index afe1720..ac0a8b0 100755
--- a/wgetpaste
+++ b/wgetpaste
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# A Script that automates pasting to a number of pastebin services
# relying only on bash, sed, coreutils (mktemp/sort/tr/wc/whoami/tee) and wget
-# Copyright (c) 2007-2009 Bo Ørsted Andresen <bo.andresen@zlin.dk>
+# Copyright (c) 2007-2016 Bo Ørsted Andresen <bo.andresen@zlin.dk>
# Distributed in the public domain. Do with it whatever you want.
VERSION="2.27"
@@ -919,10 +919,10 @@ else
# paste it
WGETARGS="--tries=5 --timeout=60 $WGETARGS"
- if geturl needstdout || [[ $DEBUG || ! -w /dev/null ]]; then
- OUTPUT=$(LC_ALL=C wget -O - $WGETARGS "$WGETEXTRAHEADER" $RECIPIENT 2>&1)
+ if geturl needstdout ; then
+ OUTPUT=$(LC_ALL=C wget -O - $WGETARGS ${WGETEXTRAHEADER:+"$WGETEXTRAHEADER"} $RECIPIENT 2>&1)
else
- OUTPUT=$(LC_ALL=C wget -O /dev/null $WGETARGS "$WGETEXTRAHEADER" $RECIPIENT 2>&1)
+ OUTPUT=$(LC_ALL=C wget -O /dev/null $WGETARGS ${WGETEXTRAHEADER:+"$WGETEXTRAHEADER"} $RECIPIENT 2>&1)
fi
# clean temporary file if it was created