X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Frmf.c;h=f214f59a8e12baa3ed46e178e267dede1a742587;hp=36c1eed24da18fcc4ece9557c28fc8dd7fa694d1;hb=5b792c4424571f05bc2008e3109797d18d7d00d1;hpb=8e5be81f784682822f5e868c1bf3c8624682bd23 diff --git a/uip/rmf.c b/uip/rmf.c index 36c1eed..f214f59 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -48,26 +48,26 @@ main(int argc, char **argv) while ((cp = *argp++)) { if (*cp == '-') { switch (smatch(++cp, switches)) { - case AMBIGSW: - ambigsw(cp, switches); - done(1); - case UNKWNSW: - adios(NULL, "-%s unknown", cp); - - case HELPSW: - snprintf(buf, sizeof(buf), "%s [+folder] [switches]", invo_name); - print_help(buf, switches, 1); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - case INTRSW: - interactive = 1; - continue; - case NINTRSW: - interactive = 0; - continue; + case AMBIGSW: + ambigsw(cp, switches); + done(1); + case UNKWNSW: + adios(NULL, "-%s unknown", cp); + + case HELPSW: + snprintf(buf, sizeof(buf), "%s [+folder] [switches]", invo_name); + print_help(buf, switches, 1); + done(1); + case VERSIONSW: + print_version(invo_name); + done(1); + + case INTRSW: + interactive = 1; + continue; + case NINTRSW: + interactive = 0; + continue; } } if (*cp == '+' || *cp == '@') { @@ -134,20 +134,21 @@ rmf(char *folder) register DIR *dd; switch (i = chdir(maildir = toabsdir(folder))) { - case OK: - if (access(".", W_OK) != NOTOK && - access("..", W_OK) != NOTOK) - break; /* fall otherwise */ - - case NOTOK: - snprintf(cur, sizeof(cur), "atr-%s-%s", - current, toabsdir(folder)); - if (!context_del(cur)) { - printf("[+%s de-referenced]\n", folder); - return OK; - } - advise(NULL, "you have no profile entry for the %s folder +%s", i == NOTOK ? "unreadable" : "read-only", folder); - return NOTOK; + case OK: + if (access(".", W_OK) != NOTOK && access("..", W_OK) != NOTOK) + break; /* fall otherwise */ + + case NOTOK: + snprintf(cur, sizeof(cur), "atr-%s-%s", + current, toabsdir(folder)); + if (!context_del(cur)) { + printf("[+%s de-referenced]\n", folder); + return OK; + } + advise(NULL, "you have no profile entry for the %s folder +%s", + i == NOTOK ? "unreadable" : "read-only", + folder); + return NOTOK; } if ((dd = opendir(".")) == NULL) @@ -163,33 +164,33 @@ rmf(char *folder) j = strlen(backup_prefix); while ((dp = readdir(dd))) { switch (dp->d_name[0]) { - case '.': - if (strcmp(dp->d_name, ".") == 0 || - strcmp(dp->d_name, "..") == 0) - continue; /* else fall */ + case '.': + if (strcmp(dp->d_name, ".") == 0 || + strcmp(dp->d_name, "..") == 0) + continue; /* else fall */ - case ',': + case ',': #ifdef MHE - case '+': + case '+': #endif /* MHE */ #ifdef UCI - case '_': - case '#': + case '_': + case '#': #endif /* UCI */ + break; + + default: + if (m_atoi(dp->d_name)) + break; + if (strcmp(dp->d_name, altmsglink) == 0 || + strncmp(dp->d_name, + backup_prefix, j) == 0) break; - default: - if (m_atoi(dp->d_name)) - break; - if (strcmp(dp->d_name, altmsglink) == 0 || - strncmp(dp->d_name, - backup_prefix, j) == 0) - break; - - admonish(NULL, "file \"%s/%s\" not deleted", - folder, dp->d_name); - others++; - continue; + admonish(NULL, "file \"%s/%s\" not deleted", + folder, dp->d_name); + others++; + continue; } if (unlink(dp->d_name) == NOTOK) { admonish(dp->d_name, "unable to unlink %s:", folder);