X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fscan.c;h=69c2da97a13b4eeb9ff4176f6f34396ba4198b76;hp=5cac62641839e3ff16761ca7f4b9bf0c5d8406a3;hb=5b792c4424571f05bc2008e3109797d18d7d00d1;hpb=8e5be81f784682822f5e868c1bf3c8624682bd23 diff --git a/uip/scan.c b/uip/scan.c index 5cac626..69c2da9 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -88,64 +88,67 @@ 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] [msgs] [switches]", invo_name); - print_help(buf, switches, 1); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - case CLRSW: - clearflag++; - continue; - case NCLRSW: - clearflag = 0; - continue; - - case FORMSW: - if (!(form = *argp++) || *form == '-') - adios(NULL, "missing argument to %s", argp[-2]); - format = NULL; - continue; - case FMTSW: - if (!(format = *argp++) || - *format == '-') - adios(NULL, "missing argument to %s", argp[-2]); - form = NULL; - continue; - - case HEADSW: - hdrflag++; - continue; - case NHEADSW: - hdrflag = 0; - continue; - - case WIDTHSW: - if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); - width = atoi(cp); - continue; - case REVSW: - revflag++; - continue; - case NREVSW: - revflag = 0; - continue; - - case FILESW: - if (!(cp = *argp++) || (cp[0] == '-' && cp[1])) - adios(NULL, "missing argument to %s", argp[-2]); - if (strcmp(file = cp, "-")!=0) - file = getcpy(expanddir(cp)); - continue; + case AMBIGSW: + ambigsw(cp, switches); + done(1); + case UNKWNSW: + adios(NULL, "-%s unknown", cp); + + case HELPSW: + snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); + print_help(buf, switches, 1); + done(1); + case VERSIONSW: + print_version(invo_name); + done(1); + + case CLRSW: + clearflag++; + continue; + case NCLRSW: + clearflag = 0; + continue; + + case FORMSW: + if (!(form = *argp++) || *form == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + format = NULL; + continue; + case FMTSW: + if (!(format = *argp++) || *format == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + form = NULL; + continue; + + case HEADSW: + hdrflag++; + continue; + case NHEADSW: + hdrflag = 0; + continue; + + case WIDTHSW: + if (!(cp = *argp++) || *cp == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + width = atoi(cp); + continue; + case REVSW: + revflag++; + continue; + case NREVSW: + revflag = 0; + continue; + + case FILESW: + if (!(cp = *argp++) || (cp[0] == '-' && cp[1])) + adios(NULL, "missing argument to %s", + argp[-2]); + if (strcmp(file = cp, "-")!=0) + file = getcpy(expanddir(cp)); + continue; } } if (*cp == '+' || *cp == '@') { @@ -289,23 +292,21 @@ main(int argc, char **argv) switch (state = scan(in, msgnum, 0, nfs, width, msgnum == mp->curmsg, unseen, folder, 0L, 1)) { - case SCNMSG: - case SCNENC: - case SCNERR: - break; + case SCNMSG: + case SCNENC: + case SCNERR: + break; - default: - adios(NULL, "scan() botch(%d)", state); + default: + adios(NULL, "scan() botch(%d)", state); - case SCNEOF: + case SCNEOF: #if 0 - printf("%*d empty\n", DMAXFOLDER, - msgnum); + printf("%*d empty\n", DMAXFOLDER, msgnum); #else - advise(NULL, "message %d: empty", - msgnum); + advise(NULL, "message %d: empty", msgnum); #endif - break; + break; } hdrflag = 0; fclose(in);