]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix off-by-one file size formatting in ls-lisp
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 12 Feb 2022 07:07:42 +0000 (08:07 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 12 Feb 2022 07:07:42 +0000 (08:07 +0100)
* 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).

lisp/ls-lisp.el

index e7118a2a376cc84a1f5dce7786d50b2e9180384c..7a4be3c7e4c6843f740b249015628df2acf5f027 100644 (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."