ls: make "ls -s DIR" show total too. Clases 4946
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Feb 2014 14:40:26 +0000 (15:40 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Feb 2014 14:40:26 +0000 (15:40 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/ls.c

index 166473d4d7a6fe5430a826d5a6a8978cdb18d481..1b63be56d7102ef1e8d75cb929b382de0325db4f 100644 (file)
@@ -1032,7 +1032,7 @@ static void scan_and_display_dirs_recur(struct dnode **dn, int first)
                }
                subdnp = scan_one_dir((*dn)->fullname, &nfiles);
 #if ENABLE_DESKTOP
-               if ((G.all_fmt & STYLE_MASK) == STYLE_LONG)
+               if ((G.all_fmt & STYLE_MASK) == STYLE_LONG || (G.all_fmt & LIST_BLOCKS))
                        printf("total %"OFF_FMT"u\n", calculate_blocks(subdnp));
 #endif
                if (nfiles > 0) {