forked from josch/mmdebstrap
avoid division by zero in progress computation
This commit is contained in:
parent
ccd8919e67
commit
2fd3d768e8
1 changed files with 5 additions and 1 deletions
|
@ -950,7 +950,11 @@ sub run_dpkg_progress {
|
|||
}
|
||||
$num += 1;
|
||||
}
|
||||
return $num / $total * 100, $status;
|
||||
if ($total == 0) {
|
||||
return 0, $status;
|
||||
} else {
|
||||
return $num / $total * 100, $status;
|
||||
}
|
||||
};
|
||||
run_progress $get_exec, $line_handler, $line_has_error;
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue