From 3e356c9539396c96d5e0645a3af551cdb538f54c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 17 Jul 2011 23:33:27 +0200 Subject: 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 --- fb.in | 8 +++++--- 1 file 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() { -- cgit v1.2.3-24-g4f1b