X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fdp.c;h=a9940d3a9115f14c1a593ac79116392d816de013;hb=4150402bbbee49b71286c9d278b5e7e9a5401bc2;hp=a5accf53f19031c9b68f8b48ac753221155f8fc2;hpb=240013872c392fe644bd4f79382d9f5314b4ea60;p=mmh diff --git a/uip/dp.c b/uip/dp.c index a5accf5..a9940d3 100644 --- a/uip/dp.c +++ b/uip/dp.c @@ -68,36 +68,39 @@ 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 [switches] dates ...", invo_name); - print_help(buf, switches, 1); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - 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 WIDTHSW: - if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); - width = atoi(cp); - continue; + case AMBIGSW: + ambigsw(cp, switches); + done(1); + case UNKWNSW: + adios(NULL, "-%s unknown", cp); + + case HELPSW: + snprintf(buf, sizeof(buf), "%s [switches] dates ...", invo_name); + print_help(buf, switches, 1); + done(1); + case VERSIONSW: + print_version(invo_name); + done(1); + + 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 WIDTHSW: + if (!(cp = *argp++) || *cp == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + width = atoi(cp); + continue; } } if (datep > NDATES) @@ -111,7 +114,7 @@ main(int argc, char **argv) adios(NULL, "usage: %s [switches] dates ...", invo_name); /* get new format string */ - nfs = new_fs(form, format, FORMAT); + nfs = new_fs(form, format, NULL, FORMAT); if (width == 0) { if ((width = sc_width()) < WIDTH / 2)