]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
stat: use decomposed decimal device numbers by default
authorPádraig Brady <P@draigBrady.com>
Sun, 20 Jun 2021 20:26:21 +0000 (21:26 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 21 Jun 2021 11:03:42 +0000 (12:03 +0100)
* src/stat.c (default_format): Use decomposed decimal
representation (major,minor) in the default format.
This is least ambiguous for human interpretation,
and more consistent with ls for example.
Fixes https://bugs.gnu.org/48960

NEWS
src/stat.c

diff --git a/NEWS b/NEWS
index a2d28cfc860f416159c7bbae19bb3a896714d646..02b57470f243a23993a59b2b877fe6aac65b2668 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -63,6 +63,9 @@ GNU coreutils NEWS                                    -*- outline -*-
   for 8-bit non-ASCII alphabetic characters.  TeX indexes should
   instead use '\usepackage[latin1]{inputenc}' or equivalent.
 
+  stat will use decomposed (major,minor) device numbers in its default format.
+  This is less ambiguous, and more consistent with ls.
+
 ** New Features
 
   expr and factor now support bignums on all platforms.
index 0f3039b58376c415906aef8cfb8692f401a13730..867e91ce09f12b412da50b8cf677b7a4952d271b 100644 (file)
@@ -1677,7 +1677,7 @@ default_format (bool fs, bool terse, bool device)
               /* TRANSLATORS: This string uses format specifiers from
                  'stat --help' without --file-system, and NOT from printf.  */
               format = xasprintf ("%s%s", format, _("\
-" "Device: %Dh/%dd\tInode: %-10i  Links: %-5h Device type: %t,%T\n\
+" "Device: %Hd,%Ld\tInode: %-10i  Links: %-5h Device type: %Hr,%Lr\n\
 "));
             }
           else
@@ -1685,7 +1685,7 @@ default_format (bool fs, bool terse, bool device)
               /* TRANSLATORS: This string uses format specifiers from
                  'stat --help' without --file-system, and NOT from printf.  */
               format = xasprintf ("%s%s", format, _("\
-" "Device: %Dh/%dd\tInode: %-10i  Links: %h\n\
+" "Device: %Hd,%Ld\tInode: %-10i  Links: %h\n\
 "));
             }
           free (temp);