From: Francois Fleuret Date: Thu, 18 Mar 2010 19:25:42 +0000 (+0100) Subject: Now do not ignore ./something when the -d option is present. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=0c962f1c0fabf85606069ab40c7b943a28c61abd;p=finddup.git Now do not ignore ./something when the -d option is present. --- diff --git a/finddup.c b/finddup.c index bf59852..aa16dac 100644 --- a/finddup.c +++ b/finddup.c @@ -90,7 +90,7 @@ int ignore_entry(const char *name) { return strcmp(name, ".") == 0 || strcmp(name, "..") == 0 || - (ignore_dotfiles && name[0] == '.'); + (ignore_dotfiles && name[0] == '.' && name[1] != '/'); } /**********************************************************************/ @@ -176,6 +176,7 @@ int same_content(struct file_node *f1, struct file_node *f2, f2->name, strerror(errno)); } + exit(EXIT_FAILURE); } } @@ -190,8 +191,7 @@ int same_files(struct file_node *f1, struct file_node *f2, /**********************************************************************/ -struct file_node *scan_directory(struct file_node *tail, - const char *name) { +struct file_node *scan_directory(struct file_node *tail, const char *name) { DIR *dir; struct dirent *dir_e; struct stat sb;