From: Pádraig Brady Date: Sun, 20 Jun 2021 20:26:21 +0000 (+0100) Subject: stat: use decomposed decimal device numbers by default X-Git-Tag: v9.0~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f8e6fc202b53b02c0a213c6ca751e87a4b3caa5;p=thirdparty%2Fcoreutils.git stat: use decomposed decimal device numbers by default * 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 --- diff --git a/NEWS b/NEWS index a2d28cfc86..02b57470f2 100644 --- 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. diff --git a/src/stat.c b/src/stat.c index 0f3039b583..867e91ce09 100644 --- a/src/stat.c +++ b/src/stat.c @@ -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);