From: Francois Fleuret Date: Thu, 25 Feb 2010 21:09:45 +0000 (+0100) Subject: Changed the buffer size, added the setlocale. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=054abc1c6c091414c49ce18a88de51d6dd1a276d;p=dus.git Changed the buffer size, added the setlocale. --- diff --git a/dus.c b/dus.c index 5b19766..338b69b 100644 --- a/dus.c +++ b/dus.c @@ -34,10 +34,12 @@ #include #include -#define BUFFER_SIZE 1024 +#define BUFFER_SIZE 4096 typedef int64_t size_sum_t; +/********************************************************************/ + size_sum_t file_or_dir_size(char *name) { DIR *dir; struct dirent *dir_e; @@ -121,7 +123,6 @@ int compare_files(const void *x1, const void *x2) { } } - void print_sorted(struct file_with_size *root, int height) { struct file_with_size *node; struct file_with_size **nodes; @@ -184,6 +185,8 @@ int main(int argc, char **argv) { root = 0; + setlocale (LC_ALL, ""); + if(argc > 1) { for(k = 1; k < argc; k++) { root = create(argv[k], root);