nb_nodes = 0;
for(node = root; node; node = node->next) {
- nb_nodes++;
+ if(size_min < 0 || node->size >= size_min) {
+ nb_nodes++;
+ }
}
nodes = safe_malloc(nb_nodes * sizeof(struct file_with_size *));
n = 0;
for(node = root; node; node = node->next) {
- nodes[n++] = node;
+ if(size_min < 0 || node->size >= size_min) {
+ nodes[n++] = node;
+ }
}
qsort(nodes, nb_nodes, sizeof(struct file_with_size *), compare_files);
}
for(n = first; n < last; n++) {
- if(size_min < 0 || nodes[n]->size >= size_min) {
- if(fancy_size_display) {
- fancy_print(line, nodes[n]->filename, nodes[n]->size);
- } else {
- raw_print(line, nodes[n]->filename, nodes[n]->size);
- }
- if(width >= 0 && width < BUFFER_SIZE) {
- line[width] = '\0';
- }
- printf(line);
+ if(fancy_size_display) {
+ fancy_print(line, nodes[n]->filename, nodes[n]->size);
+ } else {
+ raw_print(line, nodes[n]->filename, nodes[n]->size);
+ }
+ if(width >= 0 && width < BUFFER_SIZE) {
+ line[width] = '\0';
}
+ printf(line);
}
if(height >= 0 && nb_nodes > height && show_top && !forced_height) {