diff options
Diffstat (limited to 'libbb/remove_file.c')
-rw-r--r-- | libbb/remove_file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libbb/remove_file.c b/libbb/remove_file.c index 65708a252..8b45c58b8 100644 --- a/libbb/remove_file.c +++ b/libbb/remove_file.c | |||
@@ -79,11 +79,9 @@ extern int remove_file(const char *path, int flags) | |||
79 | while ((d = readdir(dp)) != NULL) { | 79 | while ((d = readdir(dp)) != NULL) { |
80 | char *new_path; | 80 | char *new_path; |
81 | 81 | ||
82 | if (strcmp(d->d_name, ".") == 0 || | 82 | new_path = concat_subpath_file(path, d->d_name); |
83 | strcmp(d->d_name, "..") == 0) | 83 | if(new_path == NULL) |
84 | continue; | 84 | continue; |
85 | |||
86 | new_path = concat_path_file(path, d->d_name); | ||
87 | if (remove_file(new_path, flags) < 0) | 85 | if (remove_file(new_path, flags) < 0) |
88 | status = -1; | 86 | status = -1; |
89 | free(new_path); | 87 | free(new_path); |