From a43e305413e3cce45496bcbfa6845b7fd6c206cc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 May 2008 10:28:39 +0000 Subject: [PATCH] (ls-lisp-insert-directory): Use `string-width' instead of `length' for comparing length of user and group names. --- lisp/ChangeLog | 5 +++++ lisp/ls-lisp.el | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 84d1f3e5833..8e0828a09cb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-05-03 Eli Zaretskii + + * ls-lisp.el (ls-lisp-insert-directory): Use `string-width' + instead of `length' for comparing length of user and group names. + 2008-05-03 Eric S. Raymond * vc-dispatcher.el: New file, separates out the UI and command diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index f1a05a6f8c8..4f13a023ab8 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -329,9 +329,11 @@ not contain `d', so that a full listing is expected." (dolist (elt file-alist) (setq attr (cdr elt) fuid (nth 2 attr) - uid-len (length (if (stringp fuid) fuid (format "%d" fuid))) + uid-len (if (stringp fuid) (string-width fuid) + (length (format "%d" fuid))) fgid (nth 3 attr) - gid-len (length (if (stringp fgid) fgid (format "%d" fgid))) + gid-len (if (stringp fgid) (string-width fgid) + (length (format "%d" fgid))) file-size (nth 7 attr)) (if (> uid-len max-uid-len) (setq max-uid-len uid-len)) -- 2.39.5