X-Git-Url: http://git.thejh.net/?p=cleanmysourcetree.git;a=blobdiff_plain;f=cleanmysourcetree.c;h=f989b72078b18b119f15b7d84ba780be569d4ce3;hp=cc116cae5ef08ea658dd896719db7ca03a54b69f;hb=a005b735551edafb2bd47260bf34cccbc119fc9b;hpb=af483b5ba9bd4d85a911fa5940b80f0aa22c311c diff --git a/cleanmysourcetree.c b/cleanmysourcetree.c index cc116ca..f989b72 100644 --- a/cleanmysourcetree.c +++ b/cleanmysourcetree.c @@ -96,11 +96,7 @@ static void add_files_recursive(const char *current_path) { continue; char file_path[strlen(current_path) + 1 + strlen(entry.d_name) + 1]; - if (strcmp(current_path, ".") == 0) { - strcpy(file_path, entry.d_name); - } else { - sprintf(file_path, "%s/%s", current_path, entry.d_name); - } + sprintf(file_path, "%s/%s", current_path, entry.d_name); struct stat st; if (lstat(file_path, &st)) @@ -119,6 +115,7 @@ static void add_files_recursive(const char *current_path) { } } add_dir(current_path); + closedir(d); } volatile bool child_quit = false;