X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhmail.c;h=a013ecb8361811898eecb0a30031819dacc27fb1;hp=c7a7afafc53b341f72b488a5ed91ab5f18c62732;hb=5b792c4424571f05bc2008e3109797d18d7d00d1;hpb=714b5c530ece27ea2835a313013f5b770163403c diff --git a/uip/mhmail.c b/uip/mhmail.c index c7a7afa..a013ecb 100644 --- a/uip/mhmail.c +++ b/uip/mhmail.c @@ -54,7 +54,7 @@ main(int argc, char **argv) #ifdef LOCALE setlocale(LC_ALL, ""); #endif - invo_name = r1bindex(argv[0], '/'); + invo_name = mhbasename(argv[0]); /* foil search of user profile/context */ if (context_foil(NULL) == -1) @@ -62,7 +62,7 @@ main(int argc, char **argv) /* If no arguments, just incorporate new mail */ if (argc == 1) { - execlp(incproc, r1bindex(incproc, '/'), NULL); + execlp(incproc, mhbasename(incproc), NULL); adios(incproc, "unable to exec"); } @@ -72,46 +72,51 @@ 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 [addrs ... [switches]]", invo_name); - print_help(buf, switches, 0); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - case FROMSW: - if (!(from = *argp++) || *from == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case BODYSW: - if (!(body = *argp++) || *body == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case CCSW: - iscc++; - continue; - - case SUBJSW: - if (!(subject = *argp++) || *subject == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case RESNDSW: - resent++; - continue; - - case QUEUESW: - queued++; - continue; + case AMBIGSW: + ambigsw(cp, switches); + done(1); + case UNKWNSW: + adios(NULL, "-%s unknown", cp); + + case HELPSW: + snprintf(buf, sizeof(buf), + "%s [addrs ... [switches]]", + invo_name); + print_help(buf, switches, 0); + done(1); + case VERSIONSW: + print_version(invo_name); + done(1); + + case FROMSW: + if (!(from = *argp++) || *from == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case BODYSW: + if (!(body = *argp++) || *body == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case CCSW: + iscc++; + continue; + + case SUBJSW: + if (!(subject = *argp++) || *subject == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case RESNDSW: + resent++; + continue; + + case QUEUESW: + queued++; + continue; } } if (iscc) @@ -135,7 +140,7 @@ main(int argc, char **argv) fprintf(out, "%sTo: %s\n", resent ? "Resent-" : "", tolist); if (cclist) - fprintf(out, "%scc: %s\n", resent ? "Resent-" : "", cclist); + fprintf(out, "%sCc: %s\n", resent ? "Resent-" : "", cclist); if (subject) fprintf(out, "%sSubject: %s\n", resent ? "Resent-" : "", subject); if (from) @@ -160,7 +165,7 @@ main(int argc, char **argv) fclose(out); nvec = 0; - vec[nvec++] = r1bindex(postproc, '/'); + vec[nvec++] = mhbasename(postproc); vec[nvec++] = tmpfil; if (resent) vec[nvec++] = "-dist";