# HG changeset patch # User Eli Zaretskii # Date 919153762 0 # Node ID 40be509c47c2fa08bb115d305c4c2cbb860d027f # Parent d968067e4580440283e40d009d6a1c805ac04146 (ls-lisp-insert-directory): Call fceiling to round the size in blocks, since it can be a float. (ls-lisp-format): Likewise diff -r d968067e4580 -r 40be509c47c2 lisp/ls-lisp.el --- a/lisp/ls-lisp.el Tue Feb 16 08:25:51 1999 +0000 +++ b/lisp/ls-lisp.el Tue Feb 16 08:29:22 1999 +0000 @@ -177,7 +177,7 @@ (search-backward "total \007") (goto-char (match-end 0)) (delete-char -1) - (insert (format "%d" (if (zerop sum) 0 (1+ (/ sum 1024))))))) + (insert (format "%.0f" (fceiling (/ sum 1024.0)))))) ;; if not full-directory-p, FILE *must not* end in /, as ;; file-attributes will not recognize a symlink to a directory ;; must make it a relative filename as ls does: @@ -246,7 +246,7 @@ (format "%6d " (nth 10 file-attr))) ;; nil is treated like "" in concat (if (memq ?s switches) ; size in K - (format "%4d " (1+ (/ (nth 7 file-attr) 1024)))) + (format "%4d " (fceiling (/ (nth 7 file-attr) 1024.0)))) (nth 8 file-attr) ; permission bits ;; numeric uid/gid are more confusing than helpful ;; Emacs should be able to make strings of them.