Fix off-by-one file size formatting in ls-lisp

* lisp/ls-lisp.el (ls-lisp-format, ls-lisp-format-file-size): The
human-readable file sizes can be 7 characters wide (e.g.,
"1016.1k") (bug#53937).
This commit is contained in:
Lars Ingebrigtsen 2022-02-12 08:07:42 +01:00
parent 53ef883b52
commit 2b97e83cc1

View file

@ -784,7 +784,7 @@ SWITCHES and TIME-INDEX give the full switch list and time data."
;; In GNU ls, -h affects the size in blocks, displayed
;; by -s, as well.
(if (memq ?h switches)
(format "%6s "
(format "%7s "
(file-size-human-readable
;; We use 1K as "block size", although
;; most Windows volumes use 4KB to 8KB
@ -881,7 +881,7 @@ All ls time options, namely c, t and u, are handled."
ls-lisp-filesize-f-fmt
ls-lisp-filesize-d-fmt)
file-size)
(format " %6s" (file-size-human-readable file-size))))
(format " %7s" (file-size-human-readable file-size))))
(defun ls-lisp-unload-function ()
"Unload ls-lisp library."