Avoid division by zero in the rare case that portsnap needs to fetch

zero patches.  (This avoids two "dc: divide by zero" warnings.)

MFC after:	3 days
This commit is contained in:
Colin Percival 2016-12-16 22:37:16 +00:00
parent 1e64280173
commit 5b3b877f89
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=310179

View File

@ -619,8 +619,10 @@ fetch_progress() {
pct_fmt()
{
printf " \r"
printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc`
if [ $TOTAL -gt 0 ]; then
printf " \r"
printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc`
fi
}
fetch_progress_percent() {