diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/output.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/output.c b/src/output.c index 93ef6f5..45f04a6 100644 --- a/src/output.c +++ b/src/output.c @@ -433,6 +433,7 @@ void print_list_formatted(const char *format, struct list_head *list) { struct list_head *lh = list; struct list_node *ptr; size_t format_len = 0, i = 0; + size_t total_size = 0; if (format == NULL || format[0] == '\0') { LOGERR("ERROR: No format string given"); @@ -509,8 +510,12 @@ void print_list_formatted(const char *format, struct list_head *list) { }; } out_print_newline(); + total_size += (ptr->ln_stat.st_size>0) ? (unsigned long int)ptr->ln_stat.st_size : 0; ptr = ptr->next; } + fputc_all_cols('=', stdout); + printf("\nTotal size: %lu %s\n", ((total_size>1024) ? total_size/1024 : total_size), + ((total_size >= 1024) ? "kB" : "")); if (lh != list) destroy_list(lh); } |
