1.1 --- a/libe2access/lib/src/utils.c Wed Feb 16 18:21:01 2022 +0100
1.2 +++ b/libe2access/lib/src/utils.c Wed Feb 16 18:38:11 2022 +0100
1.3 @@ -44,6 +44,10 @@
1.4 else
1.5 data.filename = NULL;
1.6
1.7 + /* Do not show link counts by default. */
1.8 +
1.9 + data.link_count = 0;
1.10 +
1.11 return image_list_dir(fs, path, utils_list_dir_proc, &data);
1.12 }
1.13
1.14 @@ -76,6 +80,11 @@
1.15 inode.i_gid,
1.16 EXT2_I_SIZE(&inode));
1.17
1.18 + /* Show link counts if requested. */
1.19 +
1.20 + if (data->link_count)
1.21 + printf("%6d ", inode.i_links_count);
1.22 +
1.23 /* Output the name which is presumably not necessarily null-terminated. */
1.24
1.25 fwrite(dirent->name, sizeof(char), ext2fs_dirent_name_len(dirent), stdout);