aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2020-03-10 12:26:29 +0200
committerDylan Araps <dylan.araps@gmail.com>2020-03-10 12:26:29 +0200
commitc0d0d65aa04ca1dea17e4287d89d1e5eaa391ea8 (patch)
tree67c607c12b8248bc13a457b99c737dd52c901da1
parenta8a3e1f2fe54b7b9e662c612ed7975fa73f5fdf7 (diff)
downloadpfetch-c0d0d65aa04ca1dea17e4287d89d1e5eaa391ea8.tar.gz
pfetch: Fix blank lines
-rwxr-xr-xpfetch10
1 files changed, 8 insertions, 2 deletions
diff --git a/pfetch b/pfetch
index 5c1565a..4e67358 100755
--- a/pfetch
+++ b/pfetch
@@ -1466,8 +1466,14 @@ main() {
info_length=$((info_length + 1))
while IFS= read -r line || [ "$1" ]; do
- "get_$1"
- shift "$(($# ? 1 : 0))"
+ # Iterate over the info skipping any lines
+ # which are blank.
+ for info; do
+ "get_$1"
+ shift "$(($# ? 1 : 0))"
+ [ "$out" ] && break
+ done
+
printf '\033[%sC%s\r%s\n' "$ascii_width" "$out" "$line" >&6
out=
done <<-EOF