From 1fe61cfcf216d459173724805f37ad6e4eff4920 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 4 Jan 2015 23:45:51 +0100 Subject: sfeed_update: style --- sfeed_update | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sfeed_update b/sfeed_update index 312d1f2..2cf1ce0 100755 --- a/sfeed_update +++ b/sfeed_update @@ -54,10 +54,12 @@ fetchfeed() { # convert encoding from one encoding to another. # convertencoding(from, to) convertencoding() { - if [ ! "$1" = "" ] && [ ! "$2" = "" ] && [ ! "$1" = "$2" ]; then # from != to + # if from != to + if [ ! "$1" = "" ] && [ ! "$2" = "" ] && [ ! "$1" = "$2" ]; then iconv -cs -f "$1" -t "$2" 2> /dev/null else - cat # no convert, just output + # else no convert, just output + cat fi } @@ -68,7 +70,8 @@ feed() { tmpencfile="" encoding="$4" if [ ! "$encoding" = "" ]; then - fetchfeed "$2" "$1" "$lastupdated" | convertencoding "$encoding" "utf-8" + fetchfeed "$2" "$1" "$lastupdated" | \ + convertencoding "$encoding" "utf-8" else # detect encoding. tmpencfile=$(mktemp -p "$TMPDIR") fetchfeed "$2" "$1" "$lastupdated" > "$tmpencfile" -- cgit v1.2.3