From: Lars Ingebrigtsen Date: Sat, 12 Feb 2022 07:07:42 +0000 (+0100) Subject: Fix off-by-one file size formatting in ls-lisp X-Git-Tag: emacs-29.0.90~2365 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2b97e83cc1bffdaa923c9ebb877da2e25051e1a9;p=emacs.git 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). --- diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index e7118a2a376..7a4be3c7e4c 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -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."