X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fwhatnowsbr.c;h=f5f78d74b494b7419d11b5bc1b567ba82d3135f7;hp=a7194319bda6ef44cbba338f548961807471778d;hb=e87123959d15f3b190494dffdd8bce335c137874;hpb=e98f7f60095bceba1f32e448c421b3e862b728aa diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index a719431..f5f78d7 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -2,8 +2,6 @@ /* * whatnowsbr.c -- the WhatNow shell * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -248,7 +246,7 @@ WhatNow (int argc, char **argv) snprintf (prompt, sizeof(prompt), myprompt, invo_name); for (;;) { if (!(argp = getans (prompt, aleqs))) { - unlink (LINK); + unlink (altmsglink); done (1); } switch (smatch (*argp, aleqs)) { @@ -411,6 +409,11 @@ WhatNow (int argc, char **argv) break; } + if (*(argp+1) == (char *)0) { + advise((char *)0, "attach command requires file argument(s)."); + break; + } + /* * Build a command line that causes the user's shell to list the file name * arguments. This handles and wildcard expansion, tilde expansion, etc. @@ -634,7 +637,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, struct stat st; #ifdef HAVE_LSTAT - int slinked; + int slinked = 0; #if 0 int oumask; /* PJS: for setting permissions on symlinks. */ #endif @@ -664,9 +667,9 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, else snprintf (altpath, sizeof(altpath), "%s/%s", mp->foldpath, altmsg); if (cwd == NULL) - strncpy (linkpath, LINK, sizeof(linkpath)); + strncpy (linkpath, altmsglink, sizeof(linkpath)); else - snprintf (linkpath, sizeof(linkpath), "%s/%s", cwd, LINK); + snprintf (linkpath, sizeof(linkpath), "%s/%s", cwd, altmsglink); } if (altmsg) { @@ -974,12 +977,6 @@ check_draft (char *msgnam) } -#ifndef CYRUS_SASL -# define SASLminc(a) (a) -#else /* CYRUS_SASL */ -# define SASLminc(a) 0 -#endif /* CYRUS_SASL */ - static struct swit sendswitches[] = { #define ALIASW 0 { "alias aliasfile", 0 }, @@ -1044,7 +1041,7 @@ static struct swit sendswitches[] = { #define CLIESW 30 { "client host", -6 }, #define SERVSW 31 - { "server host", -6 }, + { "server host", 6 }, #define SNOOPSW 32 { "snoop", -5 }, #define SDRFSW 33 @@ -1053,16 +1050,12 @@ static struct swit sendswitches[] = { { "draftmessage msg", -6 }, #define SNDRFSW 35 { "nodraftfolder", -3 }, -#define SASLSW 36 - { "sasl", SASLminc(-4) }, -#define SASLMECHSW 37 - { "saslmech", SASLminc(-5) }, -#define USERSW 38 - { "user", SASLminc(-4) }, #define SNDATTACHSW 39 { "attach file", 6 }, #define SNDATTACHFORMAT 40 { "attachformat", 7 }, +#define PORTSW 41 + { "port server-port-name/number", 4 }, { NULL, 0 } }; @@ -1216,7 +1209,6 @@ sendit (char *sp, char **arg, char *file, int pushed) case SSNDSW: case SOMLSW: case SNOOPSW: - case SASLSW: vec[vecp++] = --cp; continue; @@ -1225,8 +1217,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case WIDTHSW: case CLIESW: case SERVSW: - case SASLMECHSW: - case USERSW: + case PORTSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') { advise (NULL, "missing argument to %s", argp[-2]); @@ -1312,7 +1303,7 @@ sendit (char *sp, char **arg, char *file, int pushed) #endif /* not lint */ && altmsg) { vec[vecp++] = "-dist"; - distfile = getcpy (m_scratch (altmsg, invo_name)); + distfile = getcpy (m_mktemp2(altmsg, invo_name, NULL, NULL)); if (link (altmsg, distfile) == NOTOK) adios (distfile, "unable to link %s to", altmsg); } else {