X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c703902741e0f7ce55f87e48ef0d00901195f1bc..baecaa2380db6164c1992fdffccca8ea9a61d5ba:/uip/rmf.c diff --git a/uip/rmf.c b/uip/rmf.c index 9e922475..f714c472 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -37,13 +37,7 @@ main (int argc, char **argv) char *cp, *folder = NULL, newfolder[BUFSIZ]; char buf[BUFSIZ], **argp, **arguments; -#ifdef LOCALE - setlocale(LC_ALL, ""); -#endif - invo_name = r1bindex (argv[0], '/'); - - /* read user profile/context */ - context_read(); + if (nmh_init(argv[0], 1)) { return 1; } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -109,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); } @@ -185,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++; } @@ -199,7 +193,9 @@ rmf (char *folder) */ rma (folder); - chdir (".."); + if (chdir ("..") < 0) { + advise ("..", "chdir"); + } if (others == 0 && remdir (maildir)) return OK;