projects
/
dus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7feedc1
)
Now take the -c option into account.
author
Francois Fleuret
<francois@fleuret.org>
Thu, 18 Mar 2010 07:01:43 +0000
(08:01 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Thu, 18 Mar 2010 07:01:43 +0000
(08:01 +0100)
dus.c
patch
|
blob
|
history
diff --git
a/dus.c
b/dus.c
index
97883a6
..
347ecae
100644
(file)
--- a/
dus.c
+++ b/
dus.c
@@
-300,6
+300,10
@@
void print_sorted(struct entry_node *root, int width, int height) {
height = forced_height;
}
+ if(forced_width) {
+ width = forced_width;
+ }
+
if(height >= 0 && nb_nodes > height && !show_top && !forced_height) {
printf("...\n");
}
@@
-320,8
+324,9
@@
void print_sorted(struct entry_node *root, int width, int height) {
} else {
raw_print(line, nodes[n]->name, nodes[n]->size);
}
- if(width >= 0 && width < BUFFER_SIZE) {
- line[width] = '\0';
+ if(width >= 1 && width + 1 < BUFFER_SIZE && line[width]) {
+ line[width] = '\n';
+ line[width + 1] = '\0';
}
printf(line);
}