Changed the buffer size, added the setlocale.
[dus.git] / dus.c
diff --git a/dus.c b/dus.c
index d83f930..338b69b 100644 (file)
--- a/dus.c
+++ b/dus.c
@@ -1,9 +1,9 @@
 
 /*
- *  dus is a simple utility designed to display the list of files and
- *  directories with disk occupancy, sorted according to it.
+ *  dus is a simple utility to display the files and directories
+ *  according to their total disk occupancy.
  *
- *  Copyright (c) 2009 Francois Fleuret
+ *  Copyright (c) 2010 Francois Fleuret
  *  Written by Francois Fleuret <francois@fleuret.org>
  *
  *  This file is part of dus.
 #include <string.h>
 #include <sys/ioctl.h>
 
-#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);