Add maxdepth to recurse()

This also makes more sense.
This commit is contained in:
FRIGN
2015-04-18 22:04:49 +02:00
committed by sin
parent e14d9412f8
commit 7b2465c101
10 changed files with 54 additions and 45 deletions

View File

@@ -14,7 +14,7 @@ int rm_status = 0;
void
rm(const char *path, struct stat *st, void *data, struct recursor *r)
{
if (!(r->flags & NODIRS) && st && S_ISDIR(st->st_mode)) {
if (!r->maxdepth && st && S_ISDIR(st->st_mode)) {
recurse(path, NULL, r);
if (rmdir(path) < 0) {