mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
ls: better align month abbreviations containing digits
* src/ls.c (abmon_init): Align numeric abbreviations right. * NEWS: Mention the improvement.
This commit is contained in:
1 parent
5e1a554712
commit
b1ac478653
2 files changed
+6
-1
No files matched your search
@@ -75,6 +75,9 @@ GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
** Improvements
|
||||
|
||||
ls -l now better aligns abbreviated months containing digits,
|
||||
which is common in Asian locales.
|
||||
|
||||
stat and tail now know about the "sdcardfs" file system on Android.
|
||||
stat -f -c%T now reports the file system type, and tail -f uses inotify.
|
||||
|
||||
|
||||
@@ -1131,8 +1131,10 @@ abmon_init (char abmon[12][ABFORMAT_SIZE])
|
||||
char const *abbr = nl_langinfo (ABMON_1 + i);
|
||||
if (strchr (abbr, '%'))
|
||||
return false;
|
||||
mbs_align_t alignment = isdigit (to_uchar (*abbr))
|
||||
? MBS_ALIGN_RIGHT : MBS_ALIGN_LEFT;
|
||||
size_t req = mbsalign (abbr, abmon[i], ABFORMAT_SIZE,
|
||||
&width, MBS_ALIGN_LEFT, 0);
|
||||
&width, alignment, 0);
|
||||
if (! (req < ABFORMAT_SIZE))
|
||||
return false;
|
||||
required_mon_width = MAX (required_mon_width, width);
|
||||
|
||||
Reference in new issue
Block a user