/* ** Copyright 2000-2003 Double Precision, Inc. ** See COPYING for distribution information. */ #if HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_DIRENT_H #include #define NAMLEN(dirent) strlen((dirent)->d_name) #else #define dirent direct #define NAMLEN(dirent) (dirent)->d_namlen #if HAVE_SYS_NDIR_H #include #endif #if HAVE_SYS_DIR_H #include #endif #if HAVE_NDIR_H #include #endif #endif #include #include #include #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include "maildirmisc.h" int maildir_deletefolder(const char *maildir, const char *folder) { char *s; int rc; if (*folder == '.') { errno=EINVAL; return (-1); } s=malloc(strlen(maildir)+strlen(folder)+3); if (!s) return (-1); strcat(strcat(strcpy(s, maildir), "/."), folder); rc=maildir_del(s); free(s); return (rc); }