diff options
author | Kim Alvefur <zash@zash.se> | 2023-04-09 01:34:08 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-04-09 01:34:08 +0200 |
commit | 7100d588280a514857e9e801b6a1bb6003b5d46a (patch) | |
tree | 9c3180bae0e6b1b6dbae3261f2c928389dc86246 /util/human | |
parent | 3d4d0940266a74c823de9bf85f5dae4d10c32635 (diff) | |
download | prosody-7100d588280a514857e9e801b6a1bb6003b5d46a.tar.gz prosody-7100d588280a514857e9e801b6a1bb6003b5d46a.zip |
util.human.io: Fix error with ellipsis to negative length
Can happen if you resize the terminal too narrow that the space left for
variable width columns end up negative.
Diffstat (limited to 'util/human')
-rw-r--r-- | util/human/io.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/human/io.lua b/util/human/io.lua index c2ed4904..bd499664 100644 --- a/util/human/io.lua +++ b/util/human/io.lua @@ -123,7 +123,7 @@ end local function ellipsis(s, width) if len(s) <= width then return s; end - if width == 1 then return "…"; end + if width <= 1 then return "…"; end return utf8_cut(s, width - 1) .. "…"; end |