Fix issues with 0

This commit is contained in:
Dylan 2016-04-29 10:14:55 +10:00
parent 11d80dd284
commit 1c78fb1343

View file

@ -592,20 +592,20 @@ getuptime () {
case "$minutes" in
1) minutes="1 minute" ;;
0) ;;
0) unset minutes ;;
*) minutes="$minutes minutes" ;;
esac
case "$hours" in
1) hours="1 hour" ;;
0) ;;
*) hours="$hours hours" ;;
1) hours="1 hour," ;;
0) unset hours ;;
*) hours="$hours hours," ;;
esac
case "$days" in
1) days="1 day" ;;
0) ;;
*) days="$days days" ;;
1) days="1 day," ;;
0) unset days;;
*) days="$days days," ;;
esac
uptime="up $days, $hours, $minutes"