bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: misalignment in ls -l in fr_FR locale


From: Pádraig Brady
Subject: Re: misalignment in ls -l in fr_FR locale
Date: Tue, 24 Mar 2009 15:26:19 +0000
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Pádraig Brady wrote:
> Updated patch attached.
> 
> Note caching the abbreviated months like this speeds `ls -l`
> up by around 10% which is nice, though not that important
> as ls output is mainly for processing by humans.

eep, previous patch had a few buglets...

diff --git a/src/ls.c b/src/ls.c
index 74ee2ca..91426da 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -3378,10 +3378,10 @@ align_nstrftime (char *src, size_t size, char const 
*fmt, struct tm const *tm,
 {
   const char *nfmt = fmt;
   char *rpl_fmt = NULL;
-  if (required_mon_width)
+  char *pb = NULL;
+  if (required_mon_width && (pb = strstr (fmt, "%b")))
     {
-      rpl_fmt = xmalloc (strlen (fmt) + MAX_MON_WIDTH - 2 + 1);
-      char *pb = strstr (fmt, "%b");
+      rpl_fmt = xmalloc (strlen (fmt) -2 + sizeof (abmon[0]));
       char *pfmt = rpl_fmt;
       nfmt = rpl_fmt;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]