projects
/
dus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
acb1735
)
Changed the buffer size, added the setlocale.
author
Francois Fleuret
<francois@fleuret.org>
Thu, 25 Feb 2010 21:09:45 +0000
(22:09 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Thu, 25 Feb 2010 21:09:45 +0000
(22:09 +0100)
dus.c
patch
|
blob
|
history
diff --git
a/dus.c
b/dus.c
index
5b19766
..
338b69b
100644
(file)
--- a/
dus.c
+++ b/
dus.c
@@
-34,10
+34,12
@@
#include <string.h>
#include <sys/ioctl.h>
#include <string.h>
#include <sys/ioctl.h>
-#define BUFFER_SIZE
1024
+#define BUFFER_SIZE
4096
typedef int64_t size_sum_t;
typedef int64_t size_sum_t;
+/********************************************************************/
+
size_sum_t file_or_dir_size(char *name) {
DIR *dir;
struct dirent *dir_e;
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;
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;
root = 0;
+ setlocale (LC_ALL, "");
+
if(argc > 1) {
for(k = 1; k < argc; k++) {
root = create(argv[k], root);
if(argc > 1) {
for(k = 1; k < argc; k++) {
root = create(argv[k], root);