From c21bbc8129b55f95723110ac837179dec479459c Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 12 May 2024 16:09:14 -0400 Subject: Made change to ensure that total_objects_or_content_length was > 0. --- src/lpm.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpm.lua b/src/lpm.lua index 95ebd83..e981d0d 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -2611,7 +2611,7 @@ not commonly used publically. return end if not start_time or not last_read or total_read < last_read then start_time = system.time() end - local status_line = total_objects_or_content_length and + local status_line = total_objects_or_content_length and total_objects_or_content_length > 0 and string.format("%s [%s/s][%03d%%]: ", format_bytes(total_read), format_bytes(total_read / (system.time() - start_time)), math.floor((received_objects and (received_objects/total_objects_or_content_length) or (total_read/total_objects_or_content_length) or 0)*100)) or string.format("%s [%s/s]: ", format_bytes(total_read), format_bytes(total_read / (system.time() - start_time))) local terminal_width = system.tcwidth(1) -- cgit v1.2.3