aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2024-05-12 16:09:14 -0400
committerAdam Harrison <adamdharrison@gmail.com>2024-05-12 16:09:14 -0400
commitc21bbc8129b55f95723110ac837179dec479459c (patch)
tree3cd7e4adc62f0a771fad991edaa0f1fe8f589c58 /src
parent13b8d534cb40e68d9e7e80bc0e6342e60feb4bcc (diff)
downloadlite-xl-plugin-manager-c21bbc8129b55f95723110ac837179dec479459c.tar.gz
lite-xl-plugin-manager-c21bbc8129b55f95723110ac837179dec479459c.zip
Made change to ensure that total_objects_or_content_length was > 0.
Diffstat (limited to 'src')
-rw-r--r--src/lpm.lua2
1 files changed, 1 insertions, 1 deletions
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)