summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-02-26 08:55:13 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-02-26 09:00:03 +0200
commit78fbca3703985224cb6e084217883881a874304f (patch)
tree426f15bdd5890b28d1a4de2240d70e1847eded91
parent0cd3288fafc16a9286d508fffff88e1d3a8509df (diff)
downloadluaotfload-78fbca3703985224cb6e084217883881a874304f.tar.gz
More robust progress bar building
-rw-r--r--luaotfload-fonts.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/luaotfload-fonts.lua b/luaotfload-fonts.lua
index d9b01f2..4b7ce97 100644
--- a/luaotfload-fonts.lua
+++ b/luaotfload-fonts.lua
@@ -63,10 +63,10 @@ local function progress(current, total)
-- local width = os.getenv("COLUMNS") -2 --doesn't work
local width = 78
local percent = current/total
- local gauge = format("[%s]", rep(" ", width))
+ local gauge = format("[%s]", string.rpadd(" ", width, " "))
if percent > 0 then
- done = (width * percent) >= 1 and (width * percent) or 1
- gauge = format("[%s>%s]", rep("=", done - 1), rep(" ", width - done))
+ local done = string.rpadd("=", (width * percent) - 1, "=") .. ">"
+ gauge = format("[%s]", string.rpadd(done, width, " ") )
end
if percent == 1 then
gauge = gauge .. "\n"