summaryrefslogtreecommitdiffstats
path: root/fb.in
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-07-17 23:33:27 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-08-15 11:18:41 +0200
commit3e356c9539396c96d5e0645a3af551cdb538f54c (patch)
treed48d436c26e9f7011cb64291b6fe3da25d9f2b60 /fb.in
parent33fe9846fd0eca0c452bd6966c7a270ad389dae1 (diff)
don't add error to the history
If $URL is not a URL the upload failed for some reason, so it should not be added to the history. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.in')
-rw-r--r--fb.in8
1 files changed, 5 insertions, 3 deletions
diff --git a/fb.in b/fb.in
index d1f80bb..133e3d7 100644
--- a/fb.in
+++ b/fb.in
@@ -92,9 +92,11 @@ do_upload() {
sed '$d' $TMPFILE >&2
URL=`tail -1 $TMPFILE`"$EXTENSION"
echo $URL
- CLIPBOARD="$CLIPBOARD $URL"
- touch "$FBHIST"
- echo "$URL :: $basefilename :: `date +%s` :: `stat -c %s -- "$file"`" >> "$FBHIST"
+ if echo $URL | grep -qE "^https?://"; then
+ CLIPBOARD="$CLIPBOARD $URL"
+ touch "$FBHIST"
+ echo "$URL :: $basefilename :: `date +%s` :: `stat -c %s -- "$file"`" >> "$FBHIST"
+ fi
}
read_stdin() {