summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-01-04 23:45:51 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-01-04 23:45:51 +0100
commit1fe61cfcf216d459173724805f37ad6e4eff4920 (patch)
treee11b302d615d5fcb6136f90caece31c5999f387e
parent9b2038f63b9942640dfd174bb922eec4c848ccbc (diff)
sfeed_update: style
-rwxr-xr-xsfeed_update9
1 files 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"