X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/b56c88e2847c582f9b18ae5bbda44f033cd49c42..ef1ba39e8dae81091b6c3e73e72825ef6edea3c6:/uip/rmf.c?ds=inline diff --git a/uip/rmf.c b/uip/rmf.c index 765ec9e1..4558ca30 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -103,7 +103,7 @@ main (int argc, char **argv) if (interactive) { cp = concat ("Remove folder \"", folder, "\"? ", NULL); - if (!getanswer (cp)) + if (!read_yes_or_no_if_tty (cp)) done (0); free (cp); } @@ -124,10 +124,10 @@ static int rmf (char *folder) { int i, j, others; - register char *maildir; + char *maildir; char cur[BUFSIZ]; - register struct dirent *dp; - register DIR *dd; + struct dirent *dp; + DIR *dd; switch (i = chdir (maildir = m_maildir (folder))) { case OK: @@ -154,7 +154,7 @@ rmf (char *folder) * Run the external delete hook program. */ - (void)ext_hook("del-hook", maildir, (char *)0); + (void)ext_hook("del-hook", maildir, NULL); j = strlen(BACKUP_PREFIX); while ((dp = readdir (dd))) { @@ -179,7 +179,7 @@ rmf (char *folder) others++; continue; } - if (unlink (dp->d_name) == NOTOK) { + if (m_unlink (dp->d_name) == NOTOK) { admonish (dp->d_name, "unable to unlink %s:", folder); others++; } @@ -193,7 +193,9 @@ rmf (char *folder) */ rma (folder); - chdir (".."); + if (chdir ("..") < 0) { + advise ("..", "chdir"); + } if (others == 0 && remdir (maildir)) return OK; @@ -210,11 +212,11 @@ rmf (char *folder) static void rma (char *folder) { - register int alen, j, plen; - register char *cp; - register struct node *np, *pp; + int alen, j, plen; + char *cp; + struct node *np, *pp; - alen = strlen ("atr-"); + alen = LEN("atr-"); plen = strlen (cp = m_mailpath (folder)) + 1; /*