From e0535cce8bed4be88a76ed7b769f620335dce925 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 21:28:02 -0500 Subject: [PATCH] One bug fix, one removal of an unnecessary cat. --- plugins/sprunge/sprunge.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 55dff180b..41c4c2671 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -24,7 +24,7 @@ sprunge () { local url syntax if [[ -t 0 ]]; then - if [[ "$*" ]]; then + if [[ -n "$*" ]]; then if [[ -f "$*" ]]; then # Use python to attempt to detect the syntax syntax=$(echo "try: @@ -32,7 +32,7 @@ sprunge () { print(get_lexer_for_filename('$*').aliases[0]) except: print('text')" | python) - url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) + url=$(curl -F 'sprunge=<-' http://sprunge.us < "$*") fi else cat << HERE