projects
/
finddup.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
630c461
)
Removed the double printing of results in the single dir case.
author
Francois Fleuret
<francois@fleuret.org>
Wed, 10 Mar 2010 20:00:45 +0000
(21:00 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Wed, 10 Mar 2010 20:00:45 +0000
(21:00 +0100)
finddup.c
patch
|
blob
|
history
diff --git
a/finddup.c
b/finddup.c
index
bca9c5c
..
40ce3f7
100644
(file)
--- a/
finddup.c
+++ b/
finddup.c
@@
-291,7
+291,7
@@
void print_result(struct file_with_size *list1, struct file_with_size *list2) {
if(node1->group_id >= 0) { nb++; }
}
if(node1->group_id >= 0) { nb++; }
}
- if(
show_hits
) {
+ if(
list2
) {
for(node2 = list2; node2; node2 = node2->next) {
if(node2->group_id >= 0) { nb++; }
}
for(node2 = list2; node2; node2 = node2->next) {
if(node2->group_id >= 0) { nb++; }
}
@@
-306,7
+306,7
@@
void print_result(struct file_with_size *list1, struct file_with_size *list2) {
}
}
}
}
- if(
show_hits
) {
+ if(
list2
) {
for(node2 = list2; node2; node2 = node2->next) {
if(node2->group_id >= 0) {
nodes[n++] = node2;
for(node2 = list2; node2; node2 = node2->next) {
if(node2->group_id >= 0) {
nodes[n++] = node2;
@@
-418,12
+418,13
@@
void start(const char *dirname1, const char *dirname2) {
}
}
}
}
- print_result(list1, list2);
-
- file_list_delete(list1);
-
if(dirname2) {
if(dirname2) {
+ print_result(list1, list2);
+ file_list_delete(list1);
file_list_delete(list2);
file_list_delete(list2);
+ } else {
+ print_result(list1, 0);
+ file_list_delete(list1);
}
}
}
}