fix arithmetic in minix

This commit is contained in:
Dylan Araps 2019-09-28 14:41:57 +03:00
parent 8b801b8b50
commit a43a697551

10
pfetch
View File

@ -95,7 +95,7 @@ log() {
printf '[3%sm%s\n' "${PF_COL2-7}" "$info" printf '[3%sm%s\n' "${PF_COL2-7}" "$info"
# Keep track of the number of times 'log()' has been run. # Keep track of the number of times 'log()' has been run.
: $((info_height+=1)) info_height=$((info_height + 1))
} }
get_title() { get_title() {
@ -1045,7 +1045,7 @@ get_ascii() {
# information. The 'sed' is used to strip 'm' color codes from # information. The 'sed' is used to strip 'm' color codes from
# the ascii art so they don't affect the width variable. # the ascii art so they don't affect the width variable.
while read -r line; do while read -r line; do
: $((ascii_height+=1)) ascii_height=$((ascii_height + 1))
ascii_width=$((${#line} > ascii_width ? ${#line} : ascii_width)) ascii_width=$((${#line} > ascii_width ? ${#line} : ascii_width))
# Using '<<-EOF' is the only way to loop over a command's # Using '<<-EOF' is the only way to loop over a command's
@ -1057,7 +1057,7 @@ get_ascii() {
EOF EOF
# Add a gap between the ascii art and the information. # Add a gap between the ascii art and the information.
: $((ascii_width+=4)) ascii_width=$((ascii_width + 4))
# Print the ascii art and position the cursor back where we # Print the ascii art and position the cursor back where we
# started prior to printing it. # started prior to printing it.
@ -1122,7 +1122,7 @@ main() {
done done
# Add an additional space of length to act as a gap. # Add an additional space of length to act as a gap.
: $((info_length+=1)) info_length=$((info_length + 1))
# Iterate over the above list and run any existing "get_" functions. # Iterate over the above list and run any existing "get_" functions.
for info; do "get_$info"; done for info; do "get_$info"; done
@ -1138,7 +1138,7 @@ main() {
# typically available (by default) on GNU based systems! # typically available (by default) on GNU based systems!
while [ "${i:-0}" -le "$cursor_pos" ]; do while [ "${i:-0}" -le "$cursor_pos" ]; do
printf '\n' printf '\n'
: $((i+=1)) i=$((i + 1))
done >&6 done >&6
} }