X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fcomp.c;h=45363720d99ce82961e5a9d10c9c9504e70c60da;hp=7a4936296e6ac5da9e0e7d8dcac9b184b02383e2;hb=c8195849d2e366c569271abb0f5f60f4ebf0b4d0;hpb=240013872c392fe644bd4f79382d9f5314b4ea60 diff --git a/uip/comp.c b/uip/comp.c index 7a49362..4536372 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -75,56 +75,56 @@ 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] [msg] [switches]", invo_name); - print_help(buf, switches, 1); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - case EDITRSW: - if (!(ed = *argp++) || *ed == '-') - adios(NULL, "missing argument to %s", argp[-2]); - nedit = 0; - continue; - case NEDITSW: - nedit++; - continue; - - case WHATSW: - if (!(whatnowproc = *argp++) || *whatnowproc == '-') - adios(NULL, "missing argument to %s", argp[-2]); - nwhat = 0; - continue; - case NWHATSW: - nwhat++; - continue; - - case FORMSW: - if (!(form = *argp++) || *form == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case USESW: - use++; - continue; - case NUSESW: - use = NOUSE; - continue; + case AMBIGSW: + ambigsw(cp, switches); + done(1); + case UNKWNSW: + adios(NULL, "-%s unknown", cp); + + case HELPSW: + snprintf(buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name); + print_help(buf, switches, 1); + done(1); + case VERSIONSW: + print_version(invo_name); + done(1); + + case EDITRSW: + if (!(ed = *argp++) || *ed == '-') + adios(NULL, "missing argument to %s", argp[-2]); + nedit = 0; + continue; + case NEDITSW: + nedit++; + continue; + + case WHATSW: + if (!(whatnowproc = *argp++) || *whatnowproc == '-') + adios(NULL, "missing argument to %s", argp[-2]); + nwhat = 0; + continue; + case NWHATSW: + nwhat++; + continue; + + case FORMSW: + if (!(form = *argp++) || *form == '-') + adios(NULL, "missing argument to %s", argp[-2]); + continue; + + case USESW: + use++; + continue; + case NUSESW: + use = NOUSE; + continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios(NULL, "only one folder at a time!"); else - folder = pluspath(cp); + folder = getcpy(expandfol(cp)); } else { if (msg) adios(NULL, "only one message at a time!"); @@ -135,21 +135,18 @@ main(int argc, char **argv) cwd = getcpy(pwd()); - if (!context_find("path")) - free(path("./", TFOLDER)); - if (form && (folder || msg)) - adios(NULL, "can't mix forms and folders/msgs"); + adios(NULL, "can't mix forms and folders/msgs"); if (!use && (folder || msg)) { /* ** Take a message as the "form" for the new message. */ if (!msg) - msg = "cur"; + msg = seq_cur; if (!folder) - folder = getfolder(1); - maildir = m_maildir(folder); + folder = getcurfol(); + maildir = toabsdir(folder); if (chdir(maildir) == NOTOK) adios(maildir, "unable to change directory to"); @@ -177,7 +174,8 @@ main(int argc, char **argv) in = open_form(&form, components); try_it_again: - strncpy(drft, m_draft(use ? (msg?msg:"cur") : "new"), sizeof(drft)); + strncpy(drft, m_draft(use ? (msg?msg:seq_cur) : seq_beyond), + sizeof(drft)); /* ** Check if we have an existing draft @@ -202,26 +200,26 @@ try_it_again: if (!(argp = getans("\nDisposition? ", aqrunl))) done(1); switch (i = smatch(*argp, aqrunl)) { - case NOSW: - done(0); - case NEWSW: - use = NOUSE; - goto try_it_again; - case YESW: - break; - case USELSW: - use++; - goto edit_it; - case LISTDSW: - showfile(++argp, drft); - break; - case REFILSW: - if (refile(++argp, drft) == 0) - i = YESW; - break; - default: - advise(NULL, "say what?"); - break; + case NOSW: + done(0); + case NEWSW: + use = NOUSE; + goto try_it_again; + case YESW: + break; + case USELSW: + use++; + goto edit_it; + case LISTDSW: + showfile(++argp, drft); + break; + case REFILSW: + if (refile(++argp, drft) == 0) + i = YESW; + break; + default: + advise(NULL, "say what?"); + break; } } } else if (use) { @@ -239,7 +237,7 @@ edit_it: if (nwhat) done(0); - what_now(ed, nedit, use, drft, NULL, 0, NULLMP, NULL, 0, cwd); + what_now(ed, nedit, use, drft, NULL, 0, NULLMP, NULL, cwd); done(1); return 1; }