aboutsummaryrefslogtreecommitdiff
path: root/coreutils/ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/ls.c')
-rw-r--r--coreutils/ls.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index e5375a61a..3eff5a949 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -492,12 +492,18 @@ static NOINLINE unsigned display_single(const struct dnode *dn)
492 /* Do readlink early, so that if it fails, error message 492 /* Do readlink early, so that if it fails, error message
493 * does not appear *inside* the "ls -l" line */ 493 * does not appear *inside* the "ls -l" line */
494 lpath = NULL; 494 lpath = NULL;
495#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_READLINK2
495 if (opt & OPT_l) 496 if (opt & OPT_l)
496 if (S_ISLNK(dn->dn_mode)) 497 if (S_ISLNK(dn->dn_mode))
497 lpath = xmalloc_readlink_or_warn(dn->fullname); 498 lpath = xmalloc_readlink_or_warn(dn->fullname);
499#endif
498 500
499 if (opt & OPT_i) /* show inode# */ 501 if (opt & OPT_i) /* show inode# */
500 column += printf("%7llu ", (long long) dn->dn_ino); 502#if !ENABLE_FEATURE_EXTRA_FILE_DATA
503 column += printf("%7"LL_FMT"u ", (long long) dn->dn_ino);
504#else
505 column += printf("%19"LL_FMT"u ", (long long) dn->dn_ino);
506#endif
501//TODO: -h should affect -s too: 507//TODO: -h should affect -s too:
502 if (opt & OPT_s) /* show allocated blocks */ 508 if (opt & OPT_s) /* show allocated blocks */
503 column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1)); 509 column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1));
@@ -651,7 +657,11 @@ static void display_files(struct dnode **dn, unsigned nfiles)
651 } 657 }
652 column_width += 2 658 column_width += 2
653 + ((option_mask32 & OPT_Z) ? 33 : 0) /* context width */ 659 + ((option_mask32 & OPT_Z) ? 33 : 0) /* context width */
660#if !ENABLE_FEATURE_EXTRA_FILE_DATA
654 + ((option_mask32 & OPT_i) ? 8 : 0) /* inode# width */ 661 + ((option_mask32 & OPT_i) ? 8 : 0) /* inode# width */
662#else
663 + ((option_mask32 & OPT_i) ? 20 : 0) /* inode# width */
664#endif
655 + ((option_mask32 & OPT_s) ? 5 : 0) /* "alloc block" width */ 665 + ((option_mask32 & OPT_s) ? 5 : 0) /* "alloc block" width */
656 ; 666 ;
657 ncols = (unsigned)G_terminal_width / column_width; 667 ncols = (unsigned)G_terminal_width / column_width;