Fix the case COLUMNS is unset

This commit is contained in:
Nobuyoshi Nakada 2024-05-29 21:37:40 +09:00
parent 632115c11e
commit ab353a3064
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -98,7 +98,7 @@ class DottedFormatter
@columns = nil
else
columns = ENV["COLUMNS"]&.to_i
columns = 80 unless columns.nonzero?
columns = 80 unless columns&.nonzero?
w = COUNT_WIDTH + 1
round = 20
@columns = (columns - w) / round * round + w