* complete copyright information.
*/
-#include <h/mh.h>
+#include "h/mh.h"
+#include "sbr/getarguments.h"
+#include "sbr/read_yes_or_no_if_tty.h"
+#include "sbr/concat.h"
+#include "sbr/smatch.h"
+#include "sbr/remdir.h"
+#include "sbr/ssequal.h"
+#include "sbr/m_atoi.h"
+#include "sbr/getfolder.h"
+#include "sbr/ext_hook.h"
+#include "sbr/context_save.h"
+#include "sbr/context_replace.h"
+#include "sbr/context_del.h"
+#include "sbr/context_find.h"
+#include "sbr/ambigsw.h"
+#include "sbr/path.h"
+#include "sbr/print_version.h"
+#include "sbr/print_help.h"
+#include "sbr/error.h"
#include "h/done.h"
-#include <h/utils.h>
+#include "h/utils.h"
#include "sbr/m_maildir.h"
#include "sbr/m_mktemp.h"
int
main (int argc, char **argv)
{
- int defolder = 0, interactive = -1;
+ bool defolder = false;
+ int interactive = -1;
char *cp, *folder = NULL, newfolder[BUFSIZ];
char buf[BUFSIZ], **argp, **arguments;
char *fp;
free (path ("./", TFOLDER));
if (!folder) {
folder = getfolder (1);
- defolder++;
+ defolder = true;
}
fp = m_mailpath(folder);
if (!strcmp(fp, pwd()))
static int
rmf (char *folder)
{
- int i, others;
+ int i;
+ bool others;
char *fp;
char *maildir;
char cur[BUFSIZ];
if ((dd = opendir (".")) == NULL)
die("unable to read folder +%s", folder);
- others = 0;
+ others = false;
/*
* Run the external delete hook program.
inform("file \"%s/%s\" not deleted, continuing...",
folder, dp->d_name);
- others++;
+ others = true;
continue;
}
if (m_unlink (dp->d_name) == NOTOK) {
admonish (dp->d_name, "unable to unlink %s:", folder);
- others++;
+ others = true;
}
}
if (chdir ("..") < 0) {
advise ("..", "chdir");
}
- if (others == 0 && remdir (maildir))
+ if (!others && remdir (maildir))
return OK;
inform("folder +%s not removed", folder);