- for(node1 = list1; node1; node1 = node1->next) {
- for(node2 = list2; node2; node2 = node2->next) {
- if(node1->inode != node2->inode && same_files(node1, node2)) {
- printf("%s %s \n", node1->filename, node2->filename);
+ if(not_in) {
+ for(node1 = list1; node1; node1 = node1->next) {
+ found = 0;
+
+ for(node2 = list2; !found && node2; node2 = node2->next) {
+ if(node1->inode != node2->inode && same_files(node1, node2)) {
+ found = 1;
+ }
+ }
+
+ if(!found) {
+ if(show_realpaths) {
+ printf("%s\n", realpath(node1->filename, 0));
+ } else {
+ printf("%s\n", node1->filename);
+ }
+ }
+ }
+
+ } else {
+
+ for(node1 = list1; node1; node1 = node1->next) {
+ for(node2 = list2; node2; node2 = node2->next) {
+ if(node1->inode != node2->inode && same_files(node1, node2)) {
+ if(show_realpaths) {
+ printf("%s %s\n",
+ realpath(node1->filename, 0),
+ realpath(node2->filename, 0));
+ } else {
+ printf("%s %s\n", node1->filename, node2->filename);
+ }
+ }