diff options
author | Roy Marples <roy@marples.name> | 2007-10-05 10:36:53 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-10-05 10:36:53 +0000 |
commit | 3bfba57f5b2d89a5022fac932e46ca467a4b9f26 (patch) | |
tree | c730a290d7c3c261db1d8bdf65f1662e749ecaf8 /src/librc-misc.c | |
parent | 05b8eff319536ade894d07705bc74abaf425788e (diff) |
Punt rc_rm_dir
Diffstat (limited to 'src/librc-misc.c')
-rw-r--r-- | src/librc-misc.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/librc-misc.c b/src/librc-misc.c index 11cbadc6..4a97ae00 100644 --- a/src/librc-misc.c +++ b/src/librc-misc.c @@ -95,44 +95,6 @@ char *rc_strcatpaths (const char *path1, const char *paths, ...) librc_hidden_def(rc_strcatpaths) -bool rc_rm_dir (const char *pathname, bool top) -{ - DIR *dp; - struct dirent *d; - - if ((dp = opendir (pathname)) == NULL) - return (false); - - errno = 0; - while (((d = readdir (dp)) != NULL) && errno == 0) { - if (strcmp (d->d_name, ".") != 0 && strcmp (d->d_name, "..") != 0) { - char *tmp = rc_strcatpaths (pathname, d->d_name, (char *) NULL); - if (d->d_type == DT_DIR) { - if (! rc_rm_dir (tmp, true)) - { - free (tmp); - closedir (dp); - return (false); - } - } else { - if (unlink (tmp)) { - free (tmp); - closedir (dp); - return (false); - } - } - free (tmp); - } - } - closedir (dp); - - if (top && rmdir (pathname) != 0) - return (false); - - return (true); -} -librc_hidden_def(rc_rm_dir) - char **rc_config_load (const char *file) { char **list = NULL; |