svn commit: r1934424 - subversion/trunk/subversion/svn

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177926521599.1118690.8752924227223596835@svn03-he-fi>
Author: rinrab
Date: Wed May 20 08:20:15 2026
New Revision: 1934424

Log:
Align author in 'svn list -v' by considering UTF-8 characters.

* subversion/svn/list-cmd.c
  (#includes): Add svn_utf_private.h.
  (print_dirent): Use svn_utf_cstring_utf8_width() to process author_width and
   align it using svn_utf__cstring_utf8_align_left() instead of relying on
   printf syntax.

Modified:
   subversion/trunk/subversion/svn/list-cmd.c

Modified: subversion/trunk/subversion/svn/list-cmd.c
==============================================================================
--- subversion/trunk/subversion/svn/list-cmd.c	Wed May 20 08:15:53 2026	(r1934423)
+++ subversion/trunk/subversion/svn/list-cmd.c	Wed May 20 08:20:15 2026	(r1934424)
@@ -31,6 +31,7 @@
 #include "svn_path.h"
 #include "svn_utf.h"
 #include "svn_opt.h"
+#include "private/svn_utf_private.h"
 
 #include "cl.h"
 
@@ -169,7 +170,7 @@ print_dirent(void *baton,
       /* We may have to adjust the width of th 'author' field. */
       if (dirent->last_author)
         {
-          const int author_width = (int)strlen(dirent->last_author);
+          int author_width = svn_utf_cstring_utf8_width(dirent->last_author);
           if (author_width > pb->author_width)
             {
               if (author_width < pb->max_author_width)
@@ -187,10 +188,12 @@ print_dirent(void *baton,
         }
 
       return svn_cmdline_printf
-              (scratch_pool, "%7ld %-*.*s %c %*s %12s %s%s\n",
+              (scratch_pool, "%7ld %s %c %*s %12s %s%s\n",
                dirent->created_rev,
-               pb->author_width, pb->author_width,
-               dirent->last_author ? dirent->last_author : " ? ",
+               svn_utf__cstring_utf8_align_left(
+                   dirent->last_author ? dirent->last_author : " ? ",
+                   pb->author_width,
+                   scratch_pool),
                lock ? 'O' : ' ',
                sizewidth, sizestr,
                utf8_timestr,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.