It's the common case, and saves having to skip over the NULL when
reading, and avoids the risk of the format string being passed as the
first parameter by mistake.
78 files changed:
p = mh_xstrdup(command);
split = brkstring(p, " \t", NULL);
if (split[0] == NULL) {
p = mh_xstrdup(command);
split = brkstring(p, " \t", NULL);
if (split[0] == NULL) {
- adios(NULL, "Invalid blank command found");
+ die("Invalid blank command found");
}
argvarray[0] = mh_xstrdup(r1bindex(split[0], '/'));
for (i = 1; split[i] != NULL; i++) {
if (i > MAXARGS) {
}
argvarray[0] = mh_xstrdup(r1bindex(split[0], '/'));
for (i = 1; split[i] != NULL; i++) {
if (i > MAXARGS) {
- adios(NULL, "Command exceeded argument limit");
+ die("Command exceeded argument limit");
}
argvarray[i] = mh_xstrdup(split[i]);
}
}
argvarray[i] = mh_xstrdup(split[i]);
}
if ((mypath = getenv("HOME")) == NULL) {
if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0')
if ((mypath = getenv("HOME")) == NULL) {
if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0')
- adios(NULL, "cannot determine your home directory");
+ die("cannot determine your home directory");
/* defpath is an absolute path; make sure that always MH is, too. */
setenv("MH", defpath, 1);
if (stat(defpath, &st) != -1 && (st.st_mode & S_IFREG) == 0)
/* defpath is an absolute path; make sure that always MH is, too. */
setenv("MH", defpath, 1);
if (stat(defpath, &st) != -1 && (st.st_mode & S_IFREG) == 0)
- adios(NULL, "`%s' specified by your MH environment variable is not a normal file", cp);
+ die("`%s' specified by your MH environment variable is not a normal file", cp);
if ((ib = fopen(defpath, "r")) == NULL)
if ((ib = fopen(defpath, "r")) == NULL)
- adios(NULL, "unable to read the `%s' profile specified by your MH environment variable", defpath);
+ die("unable to read the `%s' profile specified by your MH environment variable", defpath);
}
else {
defpath = concat(mypath, "/", mh_profile, NULL);
if ((ib = fopen(defpath, "r")) == NULL)
}
else {
defpath = concat(mypath, "/", mh_profile, NULL);
if ((ib = fopen(defpath, "r")) == NULL)
- adios(NULL, "Doesn't look like nmh is installed. Run install-mh to do so.");
+ die("Doesn't look like nmh is installed. Run install-mh to do so.");
*/
if ((cp = context_find ("path")) == NULL)
*/
if ((cp = context_find ("path")) == NULL)
- adios(NULL, "Your %s file does not contain a path entry.", defpath);
+ die("Your %s file does not contain a path entry.", defpath);
- adios(NULL, "Your `%s' profile file does not contain a valid path entry.", defpath);
+ die("Your `%s' profile file does not contain a valid path entry.", defpath);
if (*cp != '/')
(void)snprintf (nd = buf, sizeof(buf), "%s/%s", mypath, cp);
if (*cp != '/')
(void)snprintf (nd = buf, sizeof(buf), "%s/%s", mypath, cp);
cp = concat ("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL);
if (!read_yes_or_no_if_tty(cp))
cp = concat ("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL);
if (!read_yes_or_no_if_tty(cp))
- adios (NULL, "unable to access MH-directory \"%s\"", nd);
+ die("unable to access MH-directory \"%s\"", nd);
free (cp);
if (!makedir (nd))
free (cp);
if (!makedir (nd))
- adios (NULL, "unable to create %s", nd);
+ die("unable to create %s", nd);
}
else if ((st.st_mode & S_IFDIR) == 0)
}
else if ((st.st_mode & S_IFDIR) == 0)
- adios (NULL, "`%s' is not a directory", nd);
+ die("`%s' is not a directory", nd);
/*
* Open and read user's context file. The name of the context file comes from the
/*
* Open and read user's context file. The name of the context file comes from the
inform("\"%s\": format compile error - %s",
&usr_fstring[errpos-errctx], str);
inform("\"%s\": format compile error - %s",
&usr_fstring[errpos-errctx], str);
- adios (NULL, "%*s", errctx+1, "^");
+ die("%*s", errctx+1, "^");
if (str) charstring_push_back_chars (scanlp, str, strlen (str), 0);
break;
case FT_STRFW:
if (str) charstring_push_back_chars (scanlp, str, strlen (str), 0);
break;
case FT_STRFW:
- adios (NULL, "internal error (FT_STRFW)");
+ die("internal error (FT_STRFW)");
case FT_NUM: {
int num = value;
case FT_NUM: {
int num = value;
indent = strlen (sp);
wid -= indent;
if (wid <= 0) {
indent = strlen (sp);
wid -= indent;
if (wid <= 0) {
- adios(NULL, "putaddr -- num register (%d) must be greater "
+ die("putaddr -- num register (%d) must be greater "
"than label width (%d)", value, indent);
}
while ((c = *sp++) && charstring_chars (scanlp) < max) {
"than label width (%d)", value, indent);
}
while ((c = *sp++) && charstring_chars (scanlp) < max) {
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
if (is_selected (mp, msgnum) &&
!(vec[vecp++] = strdup (m_name (msgnum))))
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
if (is_selected (mp, msgnum) &&
!(vec[vecp++] = strdup (m_name (msgnum))))
- adios (NULL, "strdup failed");
/* Sanity check */
if (mp->numsel != 0)
/* Sanity check */
if (mp->numsel != 0)
- adios (NULL, "oops, mp->numsel should be 0");
+ die("oops, mp->numsel should be 0");
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
*/
if (mp->hghoff < mp->lowoff) {
*/
if (mp->hghoff < mp->lowoff) {
- adios(NULL, "Internal failure: high message limit < low message "
+ die("Internal failure: high message limit < low message "
"limit; possible overflow?");
}
"limit; possible overflow?");
}
/* sanity checks */
if (lo < 1)
/* sanity checks */
if (lo < 1)
- adios (NULL, "BUG: called folder_realloc with lo (%d) < 1", lo);
+ die("BUG: called folder_realloc with lo (%d) < 1", lo);
- adios (NULL, "BUG: called folder_realloc with hi (%d) < 1", hi);
+ die("BUG: called folder_realloc with hi (%d) < 1", hi);
if (mp->nummsg > 0 && lo > mp->lowmsg)
if (mp->nummsg > 0 && lo > mp->lowmsg)
- adios (NULL, "BUG: called folder_realloc with lo (%d) > mp->lowmsg (%d)",
+ die("BUG: called folder_realloc with lo (%d) > mp->lowmsg (%d)",
lo, mp->lowmsg);
if (mp->nummsg > 0 && hi < mp->hghmsg)
lo, mp->lowmsg);
if (mp->nummsg > 0 && hi < mp->hghmsg)
- adios (NULL, "BUG: called folder_realloc with hi (%d) < mp->hghmsg (%d)",
+ die("BUG: called folder_realloc with hi (%d) < mp->hghmsg (%d)",
hi, mp->hghmsg);
/* Check if we really need to reallocate anything */
hi, mp->hghmsg);
/* Check if we really need to reallocate anything */
#endif /* HAVE_FLOCK */
default:
#endif /* HAVE_FLOCK */
default:
- adios(NULL, "Internal locking error: unsupported lock type used!");
+ die("Internal locking error: unsupported lock type used!");
#ifdef HAVE_LOCKF
return LOCKF_LOCKING;
#else /* ! HAVE_LOCKF */
#ifdef HAVE_LOCKF
return LOCKF_LOCKING;
#else /* ! HAVE_LOCKF */
- adios(NULL, "lockf not supported on this system");
+ die("lockf not supported on this system");
#endif /* HAVE_LOCKF */
}
if (strcasecmp(lockname, "flock") == 0) {
#ifdef HAVE_FLOCK
return FLOCK_LOCKING;
#else /* ! HAVE_FLOCK */
#endif /* HAVE_LOCKF */
}
if (strcasecmp(lockname, "flock") == 0) {
#ifdef HAVE_FLOCK
return FLOCK_LOCKING;
#else /* ! HAVE_FLOCK */
- adios(NULL, "flock not supported on this system");
+ die("flock not supported on this system");
#endif /* HAVE_FLOCK */
}
if (strcasecmp(lockname, "dot") == 0) {
return DOT_LOCKING;
}
#endif /* HAVE_FLOCK */
}
if (strcasecmp(lockname, "dot") == 0) {
return DOT_LOCKING;
}
- adios(NULL, "Unknown lock type: \"%s\"", lockname);
+ die("Unknown lock type: \"%s\"", lockname);
/* NOTREACHED */
return 0;
}
/* NOTREACHED */
return 0;
}
adios (buffer, "unable to change directory to");
if (!(mp = folder_read (folder, 1)))
adios (buffer, "unable to change directory to");
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/*
* Make sure we have enough message status space for all
/*
* Make sure we have enough message status space for all
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
} else if (mp->lowoff > 1) {
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
} else if (mp->lowoff > 1) {
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
seq_setprev (mp);
if (mp->numsel > 1)
seq_setprev (mp);
if (mp->numsel > 1)
- adios (NULL, "only one message draft at a time!");
+ die("only one message draft at a time!");
snprintf (buffer, sizeof(buffer), "%s/%s", mp->foldpath, m_name (mp->lowsel));
cp = buffer;
snprintf (buffer, sizeof(buffer), "%s/%s", mp->foldpath, m_name (mp->lowsel));
cp = buffer;
void m_getfld_track_filepos2(m_getfld_state_t *gstate)
{
if (!*gstate)
void m_getfld_track_filepos2(m_getfld_state_t *gstate)
{
if (!*gstate)
- adios(NULL, "m_getfld_track_filepos2 without gstate");
+ die("m_getfld_track_filepos2 without gstate");
m_getfld_track_filepos(gstate, (*gstate)->iob);
}
m_getfld_track_filepos(gstate, (*gstate)->iob);
}
Ungetc(m_getfld_state_t s)
{
if (s->readpos == s->msg_buf)
Ungetc(m_getfld_state_t s)
{
if (s->readpos == s->msg_buf)
- adios(NULL, "Ungetc() at start of message buffer.");
+ die("Ungetc() at start of message buffer.");
s->readpos--;
s->bytes_read--;
s->readpos--;
s->bytes_read--;
- adios (NULL, "m_getfld() called with bogus state of %d", s->state);
+ die("m_getfld() called with bogus state of %d", s->state);
int m_getfld2(m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz)
{
if (!*gstate)
int m_getfld2(m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz)
{
if (!*gstate)
- adios(NULL, "m_getfld2 without gstate");
+ die("m_getfld2 without gstate");
return m_getfld(gstate, name, buf, bufsz, (*gstate)->iob);
}
return m_getfld(gstate, name, buf, bufsz, (*gstate)->iob);
}
s->edelimlen = c - 1;
s->delimend = s->msg_delim + s->edelimlen;
if (s->edelimlen <= 1)
s->edelimlen = c - 1;
s->delimend = s->msg_delim + s->edelimlen;
if (s->edelimlen <= 1)
- adios (NULL, "maildrop delimiter must be at least 2 bytes");
+ die("maildrop delimiter must be at least 2 bytes");
/*
* build a Boyer-Moore end-position map for the matcher in m_getfld.
/*
* build a Boyer-Moore end-position map for the matcher in m_getfld.
void m_unknown2(m_getfld_state_t *gstate)
{
if (!*gstate)
void m_unknown2(m_getfld_state_t *gstate)
{
if (!*gstate)
- adios(NULL, "m_unknown2 without gstate");
+ die("m_unknown2 without gstate");
m_unknown(gstate, (*gstate)->iob);
}
m_unknown(gstate, (*gstate)->iob);
}
mts_method = "sendmail/pipe";
sm_mts = MTS_SENDMAIL_PIPE;
} else {
mts_method = "sendmail/pipe";
sm_mts = MTS_SENDMAIL_PIPE;
} else {
- adios (NULL, "unsupported mts selection \"%s\"", value);
+ die("unsupported mts selection \"%s\"", value);
char *client_res;
if (!mh_oauth_new (&ctx, svc))
char *client_res;
if (!mh_oauth_new (&ctx, svc))
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
if (log != NULL) mh_oauth_log_to(stderr, ctx);
if (log != NULL) mh_oauth_log_to(stderr, ctx);
fp = lkfopendata(fn, "r+", &failed_to_lock);
if (fp == NULL) {
if (errno == ENOENT) {
fp = lkfopendata(fn, "r+", &failed_to_lock);
if (fp == NULL) {
if (errno == ENOENT) {
- adios(NULL, "no credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
+ die("no credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
}
adios(fn, "failed to open");
}
}
adios(fn, "failed to open");
}
}
if ((cred = mh_oauth_cred_load(fp, ctx, user)) == NULL) {
}
if ((cred = mh_oauth_cred_load(fp, ctx, user)) == NULL) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
if (!mh_oauth_access_token_valid(time(NULL), cred)) {
if (!mh_oauth_refresh(cred)) {
if (mh_oauth_get_err_code(ctx) == MH_OAUTH_NO_REFRESH) {
}
if (!mh_oauth_access_token_valid(time(NULL), cred)) {
if (!mh_oauth_refresh(cred)) {
if (mh_oauth_get_err_code(ctx) == MH_OAUTH_NO_REFRESH) {
- adios(NULL, "no valid credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
+ die("no valid credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
}
if (mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT) {
}
if (mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT) {
- adios(NULL, "credentials rejected -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
+ die("credentials rejected -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
}
inform("error refreshing OAuth2 token");
}
inform("error refreshing OAuth2 token");
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
fseek(fp, 0, SEEK_SET);
if (!mh_oauth_cred_save(fp, cred, user)) {
}
fseek(fp, 0, SEEK_SET);
if (!mh_oauth_cred_save(fp, cred, user)) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
- adios (NULL, "no blank lines are permitted in %s", file);
+ die("no blank lines are permitted in %s", file);
case FILEEOF:
break;
default:
case FILEEOF:
break;
default:
- adios (NULL, "%s is poorly formatted", file);
+ die("%s is poorly formatted", file);
user to correct it. */
inform("group or other permissions, %#o, "
"forbidden: %s", stb.st_mode, credentials_file);
user to correct it. */
inform("group or other permissions, %#o, "
"forbidden: %s", stb.st_mode, credentials_file);
- adios(NULL, "Remove password or correct file "
+ die("Remove password or correct file "
"permissions.");
}
if (token(tokval) && *apass == 0)
"permissions.");
}
if (token(tokval) && *apass == 0)
*cp++ = c;
if (cp - tokval > MAX_TOKVAL_SIZE-1) {
*cp++ = c;
if (cp - tokval > MAX_TOKVAL_SIZE-1) {
- adios(NULL, "credential tokens restricted to length %d",
+ die("credential tokens restricted to length %d",
MAX_TOKVAL_SIZE - 1);
}
}
MAX_TOKVAL_SIZE - 1);
}
}
case BODY:
lkfclosedata (fp, seqfile);
case BODY:
lkfclosedata (fp, seqfile);
- adios (NULL, "no blank lines are permitted in %s", seqfile);
+ die("no blank lines are permitted in %s", seqfile);
default:
lkfclosedata (fp, seqfile);
default:
lkfclosedata (fp, seqfile);
- adios (NULL, "%s is poorly formatted", seqfile);
+ die("%s is poorly formatted", seqfile);
}
break; /* break from for loop */
}
}
break; /* break from for loop */
}
size = 1; /* Some mallocs don't like 0. */
p = malloc(size);
if (!p)
size = 1; /* Some mallocs don't like 0. */
p = malloc(size);
if (!p)
- adios(NULL, "malloc failed, size wanted: %zu", size);
+ die("malloc failed, size wanted: %zu", size);
new = realloc(ptr, size);
if (!new)
new = realloc(ptr, size);
if (!new)
- adios(NULL, "realloc failed, size wanted: %zu", size);
+ die("realloc failed, size wanted: %zu", size);
p = calloc(nelem, elsize);
if (!p)
p = calloc(nelem, elsize);
if (!p)
- adios(NULL, "calloc failed, size wanted: %zu * %zu", nelem, elsize);
+ die("calloc failed, size wanted: %zu * %zu", nelem, elsize);
done_callback (1);
}
if (!makedir (folder))
done_callback (1);
}
if (!makedir (folder))
- adios (NULL, "unable to create folder %s", folder);
+ die("unable to create folder %s", folder);
/* Sanity check */
if (n < 0)
/* Sanity check */
if (n < 0)
- adios (NULL, "oops, num_digits called with negative value");
+ die("oops, num_digits called with negative value");
if ((dp = cp + strlen (cp) - 2) < cp || *dp != QUOTE) {
wrong_guess:
if (cp > ++dp)
if ((dp = cp + strlen (cp) - 2) < cp || *dp != QUOTE) {
wrong_guess:
if (cp > ++dp)
- adios (NULL, "vfgets() botch -- you lose big");
+ die("vfgets() botch -- you lose big");
if (*dp == '\n') {
*bp = pp;
return 0;
if (*dp == '\n') {
*bp = pp;
return 0;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] aliases ...",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] aliases ...",
case ALIASW:
if (!(cp = *argp++) || *cp == '-')
case ALIASW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((i = alias (cp)) != AK_OK)
if ((i = alias (cp)) != AK_OK)
- adios (NULL, "aliasing error in %s - %s", cp, akerror (i));
+ die("aliasing error in %s - %s", cp, akerror (i));
continue;
case NALIASW:
noalias = true;
continue;
case NALIASW:
noalias = true;
} else {
/* Should never happen, but try to protect against code changes
that could allow it. */
} else {
/* Should never happen, but try to protect against code changes
that could allow it. */
- adios (NULL, "too many arguments");
+ die("too many arguments");
for (ap = brkstring(dp = mh_xstrdup(cp), " ", "\n"); ap && *ap; ap++)
if ((i = alias (*ap)) != AK_OK)
for (ap = brkstring(dp = mh_xstrdup(cp), " ", "\n"); ap && *ap; ap++)
if ((i = alias (*ap)) != AK_OK)
- adios (NULL, "aliasing error in %s - %s", *ap, akerror (i));
+ die("aliasing error in %s - %s", *ap, akerror (i));
free(dp);
}
alias (AliasFile);
free(dp);
}
alias (AliasFile);
*/
if (inverted) {
if (vecp == 0)
*/
if (inverted) {
if (vecp == 0)
- adios (NULL, "usage: %s -user addresses ... (you forgot the addresses)",
+ die("usage: %s -user addresses ... (you forgot the addresses)",
invo_name);
for (i = 0; i < vecp; i++)
invo_name);
for (i = 0; i < vecp; i++)
struct mailname *mp, *np;
if ((pp = getname (s)) == NULL)
struct mailname *mp, *np;
if ((pp = getname (s)) == NULL)
- adios (NULL, "no address in \"%s\"", s);
+ die("no address in \"%s\"", s);
if ((mp = getm (pp, NULL, 0, NULL, 0)) == NULL)
if ((mp = getm (pp, NULL, 0, NULL, 0)) == NULL)
- adios (NULL, "bad address \"%s\"", s);
+ die("bad address \"%s\"", s);
while (getname (""))
continue;
while (getname (""))
continue;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
- adios (NULL, "only one component at a time!");
+ die("only one component at a time!");
if (!(comp = *argp++) || *comp == '-')
if (!(comp = *argp++) || *comp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "only one body at a time!");
+ die("only one body at a time!");
if (!(text = *argp++) || *text == '-')
if (!(text = *argp++) || *text == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case DELETESW: /* delete annotations */
continue;
case DELETESW: /* delete annotations */
case NUMBERSW: /* number listing or delete by number */
if (number != 0)
case NUMBERSW: /* number listing or delete by number */
if (number != 0)
- adios (NULL, "only one number at a time!");
+ die("only one number at a time!");
if (argp - arguments == argc - 1 || **argp == '-')
number = 1;
if (argp - arguments == argc - 1 || **argp == '-')
number = 1;
number = -1;
else if (!(number = atoi(*argp)))
number = -1;
else if (!(number = atoi(*argp)))
- adios (NULL, "missing argument to %s", argp[-1]);
+ die("missing argument to %s", argp[-1]);
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
if (draft != NULL) {
if (msgs.size != 0)
if (draft != NULL) {
if (msgs.size != 0)
- adios(NULL, "can only have message numbers or -draft.");
+ die("can only have message numbers or -draft.");
draft = mh_xstrdup(m_draft(folder, NULL, 1, &isdf));
draft = mh_xstrdup(m_draft(folder, NULL, 1, &isdf));
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':')
*cp = 0;
if (!**ap)
if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':')
*cp = 0;
if (!**ap)
- adios (NULL, "null component name");
+ die("null component name");
- adios (NULL, "invalid component name %s", *ap);
+ die("invalid component name %s", *ap);
if (strlen (*ap) >= NAMESZ)
if (strlen (*ap) >= NAMESZ)
- adios (NULL, "too large component name %s", *ap);
+ die("too large component name %s", *ap);
for (cp = *ap; *cp; cp++)
if (!isalnum ((unsigned char) *cp) && *cp != '-')
for (cp = *ap; *cp; cp++)
if (!isalnum ((unsigned char) *cp) && *cp != '-')
- adios (NULL, "invalid component name %s", *ap);
+ die("invalid component name %s", *ap);
mode = fstat (fd, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot ();
if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) {
mode = fstat (fd, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot ();
if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
strncpy (tmpfil, cp, sizeof(tmpfil));
chmod (tmpfil, mode);
}
strncpy (tmpfil, cp, sizeof(tmpfil));
chmod (tmpfil, mode);
if (delete >= -1 || append) {
if ((fp = fdopen(fd, "r")) == NULL)
if (delete >= -1 || append) {
if ((fp = fdopen(fd, "r")) == NULL)
- adios(NULL, "unable to fdopen file.");
+ die("unable to fdopen file.");
field = mh_xmalloc(field_size = 256);
}
field = mh_xmalloc(field_size = 256);
}
*/
if ((n = fputs(field, tmp)) == EOF || (c == '\n' && fputc('\n', tmp) == EOF))
*/
if ((n = fputs(field, tmp)) == EOF || (c == '\n' && fputc('\n', tmp) == EOF))
- adios(NULL, "unable to write temporary file.");
+ die("unable to write temporary file.");
} while (*field != '\0' && *field != '-');
} while (*field != '\0' && *field != '-');
*/
if (fp && lseek(fd, (off_t)ftell(fp), SEEK_SET) == (off_t)-1)
*/
if (fp && lseek(fd, (off_t)ftell(fp), SEEK_SET) == (off_t)-1)
- adios(NULL, "can't seek.");
cpydata (fd, fileno (tmp), file, tmpfil);
fclose (tmp);
cpydata (fd, fileno (tmp), file, tmpfil);
fclose (tmp);
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] addrs ...",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] addrs ...",
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
}
}
if (addrp == NADDRS)
width = atoi (cp);
continue;
}
}
if (addrp == NADDRS)
- adios (NULL, "more than %d addresses", NADDRS);
+ die("more than %d addresses", NADDRS);
addrs[addrp++] = cp;
}
addrs[addrp] = NULL;
if (addrp == 0)
addrs[addrp++] = cp;
}
addrs[addrp] = NULL;
if (addrp == 0)
- adios (NULL, "usage: %s [switches] addrs ...", invo_name);
+ die("usage: %s [switches] addrs ...", invo_name);
/* get new format string */
nfs = new_fs (form, format, FORMAT);
/* get new format string */
nfs = new_fs (form, format, FORMAT);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else {
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
msgnum);
} /* this pair of braces was missing before 1999-07-15 */
else
msgnum);
} /* this pair of braces was missing before 1999-07-15 */
else
- adios (NULL, "burst() botch -- you lose big");
+ die("burst() botch -- you lose big");
*/
if ((mp->hghmsg + numburst > mp->hghoff) &&
!(mp = folder_realloc (mp, mp->lowoff, mp->hghmsg + numburst)))
*/
if ((mp->hghmsg + numburst > mp->hghoff) &&
!(mp = folder_realloc (mp, mp->lowoff, mp->hghmsg + numburst)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
*mpp = mp;
j = mp->hghmsg; /* old value */
*mpp = mp;
j = mp->hghmsg; /* old value */
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
strncpy (f2, tempfile, sizeof(f2));
get_temp_dir());
}
strncpy (f2, tempfile, sizeof(f2));
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
nedit = 0;
continue;
case NEDITSW:
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case FILESW: /* compatibility */
if (file)
case FILESW: /* compatibility */
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(file = *argp++) || *file == '-')
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
isdf = NOTOK;
continue;
case DFOLDSW:
if (dfolder)
isdf = NOTOK;
continue;
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (file)
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (file)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(file = *argp++) || *file == '-')
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
continue;
case NDFLDSW:
dfolder = NULL;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
case TOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
cc = addlist(cc, cp);
continue;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
cc = addlist(cc, cp);
continue;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = addlist(from, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
from = addlist(from, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dp = NULL;
if (*cp == '@')
cp = dp = path(cp + 1, TSUBCWF);
dp = NULL;
if (*cp == '@')
cp = dp = path(cp + 1, TSUBCWF);
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi(cp)) < 10)
if ((outputlinelen = atoi(cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case SUBJECTSW:
if (!(cp = *argp++) || *cp == '-')
continue;
case SUBJECTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
subject = cp;
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
subject = cp;
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (msg)
folder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
msg = NULL;
}
if (form && (folder || msg))
msg = NULL;
}
if (form && (folder || msg))
- adios (NULL, "can't mix forms and folders/msgs");
+ die("can't mix forms and folders/msgs");
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
seq_save (mp);
if (mp->numsel > 1)
seq_save (mp);
if (mp->numsel > 1)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
if ((in = open (form = mh_xstrdup(m_name (mp->lowsel)), O_RDONLY)) == NOTOK)
adios (form, "unable to open message");
if ((in = open (form = mh_xstrdup(m_name (mp->lowsel)), O_RDONLY)) == NOTOK)
adios (form, "unable to open message");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
nedit = 0;
continue;
case NEDITSW:
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nwhat = 0;
continue;
case NWHATSW:
nwhat = 0;
continue;
case NWHATSW:
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
file = path (cp, TFILE);
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case DFOLDSW:
if (dfolder)
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
continue;
case NDFLDSW:
dfolder = NULL;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = addlist(from, cp);
continue;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
from = addlist(from, cp);
continue;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
cc = addlist(cc, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
cc = addlist(cc, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fcc = addlist(fcc, cp);
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
fcc = addlist(fcc, cp);
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi(cp)) < 10)
if ((outputlinelen = atoi(cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (msg)
folder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msg || folder))
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msg || folder))
- adios (NULL, "can't mix files and folders/msgs");
+ die("can't mix files and folders/msgs");
try_it_again:
strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft));
try_it_again:
strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft));
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
seq_setprev (mp); /* set the previous-sequence */
if (mp->numsel > 1)
seq_setprev (mp); /* set the previous-sequence */
if (mp->numsel > 1)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
}
msgnam = file ? file : mh_xstrdup(m_name (mp->lowsel));
}
msgnam = file ? file : mh_xstrdup(m_name (mp->lowsel));
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
cp = m_mktemp2(NULL, "dist", &hdrfd, NULL);
if (cp == NULL) {
cp = m_mktemp2(NULL, "dist", &hdrfd, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy(tmpfil, cp, sizeof(tmpfil));
if ((out = dup (hdrfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
}
strncpy(tmpfil, cp, sizeof(tmpfil));
if ((out = dup (hdrfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
- adios (NULL, "no file descriptors -- you lose big");
+ die("no file descriptors -- you lose big");
(void) m_unlink (tmpfil);
gstate = m_getfld_state_init(ifp);
(void) m_unlink (tmpfil);
gstate = m_getfld_state_init(ifp);
cp = m_mktemp2(NULL, "dist", &txtfd, NULL);
if (cp == NULL) {
cp = m_mktemp2(NULL, "dist", &txtfd, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
fchmod(txtfd, 0600);
strncpy (tmpfil, cp, sizeof(tmpfil));
if ((out = dup (txtfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
get_temp_dir());
}
fchmod(txtfd, 0600);
strncpy (tmpfil, cp, sizeof(tmpfil));
if ((out = dup (txtfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
- adios (NULL, "no file descriptors -- you lose big");
+ die("no file descriptors -- you lose big");
(void) m_unlink (tmpfil);
fprintf (ofp, "\n%s", buffer);
while (state == BODY) {
(void) m_unlink (tmpfil);
fprintf (ofp, "\n%s", buffer);
while (state == BODY) {
case LENERR:
case FMTERR:
case LENERR:
case FMTERR:
- adios (NULL, "format error in message %s", msgnam);
+ die("format error in message %s", msgnam);
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] dates ...",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] dates ...",
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
}
}
if (datep == NDATES)
width = atoi (cp);
continue;
}
}
if (datep == NDATES)
- adios (NULL, "more than %d dates", NDATES);
+ die("more than %d dates", NDATES);
dates[datep++] = cp;
}
dates[datep] = NULL;
if (datep == 0)
dates[datep++] = cp;
}
dates[datep] = NULL;
if (datep == 0)
- adios (NULL, "usage: %s [switches] dates ...", invo_name);
+ die("usage: %s [switches] dates ...", invo_name);
/* get new format string */
nfs = new_fs (form, format, FORMAT);
/* get new format string */
nfs = new_fs (form, format, FORMAT);
ambigsw(cp, switches);
done(1);
case UNKWNSW:
ambigsw(cp, switches);
done(1);
case UNKWNSW:
- adios(NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder1 [+folder2 ...]][switches]",
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder1 [+folder2 ...]][switches]",
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
svector_push_back (sequencesToDo, cp);
break;
svector_push_back (sequencesToDo, cp);
break;
for (; ap && *ap; ap++)
svector_push_back (sequencesToDo, *ap);
} else {
for (; ap && *ap; ap++)
svector_push_back (sequencesToDo, *ap);
} else {
- adios (NULL, "no sequence specified or %s profile entry found", usequence);
+ die("no sequence specified or %s profile entry found", usequence);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
}
}
if (form)
form = NULL;
continue;
}
}
if (form)
- adios (NULL, "only one form at a time!");
+ die("only one form at a time!");
*/
if (*++cp == '-') {
if (*++cp == '\0')
*/
if (*++cp == '-') {
if (*++cp == '\0')
- adios(NULL, "missing component name after --");
+ die("missing component name after --");
app_msgarg(&compargs, cp);
/* Grab next argument for component text */
if (!(cp = *argp++))
app_msgarg(&compargs, cp);
/* Grab next argument for component text */
if (!(cp = *argp++))
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
app_msgarg(&compargs, cp);
continue;
}
app_msgarg(&compargs, cp);
continue;
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
print_version(invo_name);
done (0);
case OTHERSW:
print_version(invo_name);
done (0);
case OTHERSW:
- adios(NULL, "internal argument error!");
+ die("internal argument error!");
continue;
case OUTSIZESW:
if (!(cp = *argp++) || *cp == '-')
continue;
case OUTSIZESW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (strcmp(cp, "max") == 0)
outputsize = INT_MAX;
else if (strcmp(cp, "width") == 0)
if (strcmp(cp, "max") == 0)
outputsize = INT_MAX;
else if (strcmp(cp, "width") == 0)
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
colwidth = atoi(cp);
continue;
case MSGNUMSW:
if (!(cp = *argp++) || *cp == '-')
colwidth = atoi(cp);
continue;
case MSGNUMSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgnum = atoi(cp);
continue;
case MSGCURSW:
if (!(cp = *argp++) || *cp == '-')
msgnum = atoi(cp);
continue;
case MSGCURSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgcur = atoi(cp);
continue;
case MSGSIZESW:
if (!(cp = *argp++) || *cp == '-')
msgcur = atoi(cp);
continue;
case MSGSIZESW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgsize = atoi(cp);
continue;
case UNSEENSW:
if (!(cp = *argp++) || *cp == '-')
msgsize = atoi(cp);
continue;
case UNSEENSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgunseen = atoi(cp);
continue;
msgunseen = atoi(cp);
continue;
if (mode == MESSAGE && !files && (*cp == '+' || *cp == '@')) {
if (folder)
if (mode == MESSAGE && !files && (*cp == '+' || *cp == '@')) {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
*/
if (!dump && compargs.size == 0 && msgs.size == 0) {
*/
if (!dump && compargs.size == 0 && msgs.size == 0) {
- adios(NULL, "usage: [switches] [+folder] msgs | strings...");
+ die("usage: [switches] [+folder] msgs | strings...");
*/
if (mode == RAW && form == NULL && format == NULL) {
*/
if (mode == RAW && form == NULL && format == NULL) {
- adios (NULL, "You must specify a format with -form or -format when "
+ die("You must specify a format with -form or -format when "
adios(maildir, "unable to change directory to");
if (!(mp = folder_read(folder, 1)))
adios(maildir, "unable to change directory to");
if (!(mp = folder_read(folder, 1)))
- adios(NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
- adios(NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
for (i = 0; i < msgs->size; i++)
if (!m_convert(mp, msgs->msgs[i]))
for (i = 0; i < msgs->size; i++)
if (!m_convert(mp, msgs->msgs[i]))
void
nonexistent_folder (int status) {
NMH_UNUSED (status);
void
nonexistent_folder (int status) {
NMH_UNUSED (status);
- adios (NULL, "folder %s does not exist", folder);
+ die("folder %s does not exist", folder);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (argfolder)
}
if (*cp == '+' || *cp == '@') {
if (argfolder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
argfolder = pluspath (cp);
} else {
if (msg)
argfolder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one (current) message at a time!");
+ die("only one (current) message at a time!");
ap = brkstring (dp, " ", "\n");
argfolder = getcpy(*ap++);
} else {
ap = brkstring (dp, " ", "\n");
argfolder = getcpy(*ap++);
} else {
- adios (NULL, "no other folder");
+ die("no other folder");
}
for (cp = mh_xstrdup(getfolder(1)); *ap; ap++)
cp = add (*ap, add (" ", cp));
}
for (cp = mh_xstrdup(getfolder(1)); *ap; ap++)
cp = add (*ap, add (" ", cp));
/* Popping a folder off of the folder stack */
if (popsw) {
if (argfolder)
/* Popping a folder off of the folder stack */
if (popsw) {
if (argfolder)
- adios (NULL, "sorry, no folders allowed with -pop");
+ die("sorry, no folders allowed with -pop");
if ((cp = context_find (stack))) {
dp = mh_xstrdup(cp);
ap = brkstring (dp, " ", "\n");
argfolder = getcpy(*ap++);
} else {
if ((cp = context_find (stack))) {
dp = mh_xstrdup(cp);
ap = brkstring (dp, " ", "\n");
argfolder = getcpy(*ap++);
} else {
- adios (NULL, "folder stack empty");
+ die("folder stack empty");
}
if (*ap) {
/* if there's anything left in the stack */
}
if (*ap) {
/* if there's anything left in the stack */
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
nedit = 0;
continue;
case NEDITSW:
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nwhat = 0;
continue;
case BILDSW:
nwhat = 0;
continue;
case BILDSW:
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FILTSW:
if (!(cp = *argp++) || *cp == '-')
file = path (cp, TFILE);
continue;
case FILTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
mime = 0;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
filter = mh_xstrdup(etcpath(cp));
mime = 0;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case DGSTSW:
if (!(cp = *argp++) || *cp == '-')
case DGSTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
digest = mh_xstrdup(cp);
mime = 0;
continue;
case ISSUESW:
if (!(cp = *argp++) || *cp == '-')
digest = mh_xstrdup(cp);
mime = 0;
continue;
case ISSUESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((issue = atoi (cp)) < 1)
if ((issue = atoi (cp)) < 1)
- adios (NULL, "bad argument %s %s", argp[-2], cp);
+ die("bad argument %s %s", argp[-2], cp);
continue;
case VOLUMSW:
if (!(cp = *argp++) || *cp == '-')
continue;
case VOLUMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((volume = atoi (cp)) < 1)
if ((volume = atoi (cp)) < 1)
- adios (NULL, "bad argument %s %s", argp[-2], cp);
+ die("bad argument %s %s", argp[-2], cp);
continue;
case DFOLDSW:
if (dfolder)
continue;
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
continue;
case NDFLDSW:
dfolder = NULL;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = addlist(from, cp);
continue;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
from = addlist(from, cp);
continue;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
cc = addlist(cc, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
cc = addlist(cc, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fcc = addlist(fcc, cp);
continue;
case SUBJECTSW:
if (!(cp = *argp++) || *cp == '-')
fcc = addlist(fcc, cp);
continue;
case SUBJECTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
subject = mh_xstrdup(cp);
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
subject = mh_xstrdup(cp);
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi(cp)) < 10)
if ((outputlinelen = atoi(cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else {
app_msgarg(&msgs, cp);
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msgs.size || folder))
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msgs.size || folder))
- adios (NULL, "can't mix files and folders/msgs");
+ die("can't mix files and folders/msgs");
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
- adios (NULL, "Unable to find input message");
+ die("Unable to find input message");
}
if (filter && access (filter, R_OK) == NOTOK)
}
if (filter && access (filter, R_OK) == NOTOK)
- adios(NULL, "m_getfld2() returned %d", state);
+ die("m_getfld2() returned %d", state);
cp = m_mktemp2(NULL, invo_name, NULL, &tmp);
if (cp == NULL) {
cp = m_mktemp2(NULL, invo_name, NULL, &tmp);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (tmpfil, cp, sizeof(tmpfil));
(void) m_unlink (tmpfil);
}
strncpy (tmpfil, cp, sizeof(tmpfil));
(void) m_unlink (tmpfil);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] +folder command "
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] +folder command "
case HOSTSW:
if (!(host = *argp++) || *host == '-')
case HOSTSW:
if (!(host = *argp++) || *host == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(user = *argp++) || *user == '-')
continue;
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case AUTHSERVICESW:
if (!(oauth_svc = *argp++) || *oauth_svc == '-')
continue;
case AUTHSERVICESW:
if (!(oauth_svc = *argp++) || *oauth_svc == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case TLSSW:
tls = true;
continue;
case TLSSW:
tls = true;
}
} else if (*cp == '+') {
if (*(cp + 1) == '\0')
}
} else if (*cp == '+') {
if (*(cp + 1) == '\0')
- adios(NULL, "Invalid null folder name");
+ die("Invalid null folder name");
add_msg(0, "SELECT \"%s\"", cp + 1);
} else {
add_msg(0, "%s", cp);
add_msg(0, "SELECT \"%s\"", cp + 1);
} else {
add_msg(0, "%s", cp);
- adios(NULL, "A hostname must be given with -host");
+ die("A hostname must be given with -host");
if (oauth_svc) {
if (netsec_set_oauth_service(nsc, oauth_svc) != OK) {
if (oauth_svc) {
if (netsec_set_oauth_service(nsc, oauth_svc) != OK) {
- adios(NULL, "OAuth2 not supported");
+ die("OAuth2 not supported");
gettimeofday(&tv_start, NULL);
if ((fd = client(host, port, buf, sizeof(buf), snoop)) == NOTOK)
gettimeofday(&tv_start, NULL);
if ((fd = client(host, port, buf, sizeof(buf), snoop)) == NOTOK)
- adios(NULL, "Connect failed: %s", buf);
+ die("Connect failed: %s", buf);
if (timestamp) {
ts_report("Connect time", &tv_start);
if (timestamp) {
ts_report("Connect time", &tv_start);
if (initialtls || tls) {
if (netsec_set_tls(nsc, 1, 0, &errstr) != OK)
if (initialtls || tls) {
if (netsec_set_tls(nsc, 1, 0, &errstr) != OK)
- adios(NULL, "%s", errstr);
if (initialtls && netsec_negotiate_tls(nsc, &errstr) != OK)
if (initialtls && netsec_negotiate_tls(nsc, &errstr) != OK)
- adios(NULL, "%s", errstr);
}
if (sasl) {
if (netsec_set_sasl_params(nsc, "imap", saslmech, imap_sasl_callback,
nsc, &errstr) != OK)
}
if (sasl) {
if (netsec_set_sasl_params(nsc, "imap", saslmech, imap_sasl_callback,
nsc, &errstr) != OK)
- adios(NULL, "%s", errstr);
}
if ((cp = netsec_readline(nsc, &len, &errstr)) == NULL) {
}
if ((cp = netsec_readline(nsc, &len, &errstr)) == NULL) {
- adios(NULL, "%s", errstr);
}
if (has_prefix(cp, "* BYE")) {
}
if (has_prefix(cp, "* BYE")) {
goto finish;
}
if (netsec_negotiate_tls(nsc, &errstr) != OK) {
goto finish;
}
if (netsec_negotiate_tls(nsc, &errstr) != OK) {
- adios(NULL, "%s", errstr);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
case AUDSW:
if (!(cp = *argp++) || *cp == '-')
case AUDSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
audfile = mh_xstrdup(m_maildir(cp));
continue;
case NAUDSW:
audfile = mh_xstrdup(m_maildir(cp));
continue;
case NAUDSW:
case FILESW:
if (!(cp = *argp++) || *cp == '-')
case FILESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = path (cp, TFILE);
/*
from = path (cp, TFILE);
/*
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
case HOSTSW:
if (!(host = *argp++) || *host == '-')
width = atoi (cp);
continue;
case HOSTSW:
if (!(host = *argp++) || *host == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(user = *argp++) || *user == '-')
continue;
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case INITTLSSW:
continue;
case INITTLSSW:
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
#endif
continue;
case PROXYSW:
if (!(proxy = *argp++) || *proxy == '-')
#endif
continue;
case PROXYSW:
if (!(proxy = *argp++) || *proxy == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
folder = pluspath (cp);
} else {
- adios (NULL, "usage: %s [+folder] [switches]", invo_name);
+ die("usage: %s [+folder] [switches]", invo_name);
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
*/
if (pop_init (host, port, user, proxy, snoop, sasl, saslmech,
tlsflag, auth_svc) == NOTOK)
*/
if (pop_init (host, port, user, proxy, snoop, sasl, saslmech,
tlsflag, auth_svc) == NOTOK)
- adios (NULL, "%s", response);
/* Check if there are any messages */
if (pop_stat (&nmsgs, &nbytes) == NOTOK)
/* Check if there are any messages */
if (pop_stat (&nmsgs, &nbytes) == NOTOK)
- adios (NULL, "%s", response);
if (nmsgs == 0) {
pop_quit();
if (nmsgs == 0) {
pop_quit();
- adios (NULL, "no mail to incorporate");
+ die("no mail to incorporate");
}
} else if (inc_type == INC_FILE) {
}
} else if (inc_type == INC_FILE) {
newmail = concat (MAILDIR, "/", MAILFIL, NULL);
}
if (stat (newmail, &s1) == NOTOK || s1.st_size == 0)
newmail = concat (MAILDIR, "/", MAILFIL, NULL);
}
if (stat (newmail, &s1) == NOTOK || s1.st_size == 0)
- adios (NULL, "no mail to incorporate");
+ die("no mail to incorporate");
if (s1.st_mode & S_IFDIR) {
DIR *md;
struct dirent *de;
if (s1.st_mode & S_IFDIR) {
DIR *md;
struct dirent *de;
i = 0;
cp = concat (newmail, "/new", NULL);
if ((md = opendir(cp)) == NULL)
i = 0;
cp = concat (newmail, "/new", NULL);
if ((md = opendir(cp)) == NULL)
- adios (NULL, "unable to open %s", cp);
+ die("unable to open %s", cp);
while ((de = readdir (md)) != NULL) {
if (de->d_name[0] == '.')
continue;
if (i >= num_maildir_entries) {
if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL)
while ((de = readdir (md)) != NULL) {
if (de->d_name[0] == '.')
continue;
if (i >= num_maildir_entries) {
if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL)
- adios(NULL, "not enough memory for %d messages", 2*i+16);
+ die("not enough memory for %d messages", 2*i+16);
num_maildir_entries = 2*i+16;
}
Maildir[i].filename = concat (cp, "/", de->d_name, NULL);
num_maildir_entries = 2*i+16;
}
Maildir[i].filename = concat (cp, "/", de->d_name, NULL);
closedir (md);
cp = concat (newmail, "/cur", NULL);
if ((md = opendir(cp)) == NULL)
closedir (md);
cp = concat (newmail, "/cur", NULL);
if ((md = opendir(cp)) == NULL)
- adios (NULL, "unable to open %s", cp);
+ die("unable to open %s", cp);
while ((de = readdir (md)) != NULL) {
if (de->d_name[0] == '.')
continue;
if (i >= num_maildir_entries) {
if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL)
while ((de = readdir (md)) != NULL) {
if (de->d_name[0] == '.')
continue;
if (i >= num_maildir_entries) {
if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL)
- adios(NULL, "not enough memory for %d messages", 2*i+16);
+ die("not enough memory for %d messages", 2*i+16);
num_maildir_entries = 2*i+16;
}
Maildir[i].filename = concat (cp, "/", de->d_name, NULL);
num_maildir_entries = 2*i+16;
}
Maildir[i].filename = concat (cp, "/", de->d_name, NULL);
free (cp);
closedir (md);
if (i == 0)
free (cp);
closedir (md);
if (i == 0)
- adios (NULL, "no mail to incorporate");
+ die("no mail to incorporate");
num_maildir_entries = i;
qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt);
}
num_maildir_entries = i;
qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt);
}
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
if (inc_type == INC_FILE && Maildir == NULL) {
/* Mail from a spool file. */
if (inc_type == INC_FILE && Maildir == NULL) {
/* Mail from a spool file. */
in = lkfopenspool (newmail, "r");
DROPGROUPPRIVS();
if (in == NULL)
in = lkfopenspool (newmail, "r");
DROPGROUPPRIVS();
if (in == NULL)
- adios (NULL, "unable to lock and fopen %s", newmail);
+ die("unable to lock and fopen %s", newmail);
fstat (fileno(in), &s1);
} else {
trnflag = 0;
fstat (fileno(in), &s1);
} else {
trnflag = 0;
pc.written = 0;
pc.mailout = pf;
if (pop_retr(i, pop_action, &pc) == NOTOK)
pc.written = 0;
pc.mailout = pf;
if (pop_retr(i, pop_action, &pc) == NOTOK)
- adios (NULL, "%s", response);
if (fflush (pf))
adios (cp, "write error on");
if (fflush (pf))
adios (cp, "write error on");
free (cp);
if (trnflag && pop_dele (i) == NOTOK)
free (cp);
if (trnflag && pop_dele (i) == NOTOK)
- adios (NULL, "%s", response);
scan_finished();
}
if (pop_quit () == NOTOK)
scan_finished();
}
if (pop_quit () == NOTOK)
- adios (NULL, "%s", response);
} else if (inc_type == INC_FILE && Maildir == NULL) {
/* Mail from a spool file. */
} else if (inc_type == INC_FILE && Maildir == NULL) {
/* Mail from a spool file. */
} else {
fclose (in); in = NULL;
}
} else {
fclose (in); in = NULL;
}
- adios (NULL, "failed");
ambigsw (dp, switches);
done (1);
case UNKWNSW:
ambigsw (dp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", dp);
+ die("-%s unknown\n", dp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
- adios (NULL, "%s is invalid argument", dp);
+ die("%s is invalid argument", dp);
if ((mypath = getenv("HOME")) == NULL) {
if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0')
if ((mypath = getenv("HOME")) == NULL) {
if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0')
- adios(NULL, "cannot determine your home directory");
+ die("cannot determine your home directory");
if (check)
done(0);
if (autof)
if (check)
done(0);
if (autof)
- adios (NULL, "invocation error");
- adios (NULL, "You already have an nmh profile, use an editor to modify it");
+ die("invocation error");
+ die("You already have an nmh profile, use an editor to modify it");
cp = concat ("\"", pathname, "\" doesn't exist; Create it? ", NULL);
if (autof || read_switch (cp, anoyes))
if (makedir (pathname) == 0)
cp = concat ("\"", pathname, "\" doesn't exist; Create it? ", NULL);
if (autof || read_switch (cp, anoyes))
if (makedir (pathname) == 0)
- adios (NULL, "unable to create %s", pathname);
+ die("unable to create %s", pathname);
} else {
puts("[Using existing directory]");
}
} else {
puts("[Using existing directory]");
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
svector_push_back (seqs, cp);
seqp++;
svector_push_back (seqs, cp);
seqp++;
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* print some general debugging info */
if (debugsw)
/* print some general debugging info */
if (debugsw)
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
done (1);
if (publicsw == 1 && is_readonly(mp))
done (1);
if (publicsw == 1 && is_readonly(mp))
- adios (NULL, "folder %s is read-only, so -public not allowed", folder);
+ die("folder %s is read-only, so -public not allowed", folder);
/*
* Make sure at least one sequence has been
* specified if we are adding or deleting.
*/
if (seqp == 0 && (addsw || deletesw))
/*
* Make sure at least one sequence has been
* specified if we are adding or deleting.
*/
if (seqp == 0 && (addsw || deletesw))
- adios (NULL, "-%s requires at least one -sequence argument",
+ die("-%s requires at least one -sequence argument",
addsw ? "add" : "delete");
/* Adding messages to sequences */
addsw ? "add" : "delete");
/* Adding messages to sequences */
while ((cp = *argp++)) {
if (cp[0] == '-' && cp[1] == '\0') {
if (compfile)
while ((cp = *argp++)) {
if (cp[0] == '-' && cp[1] == '\0') {
if (compfile)
- adios (NULL, "cannot specify both standard input and a file");
+ die("cannot specify both standard input and a file");
compfile = cp;
listsw = 0; /* turn off -list if using standard in/out */
verbosw = 0; /* turn off -verbose listings */
compfile = cp;
listsw = 0; /* turn off -list if using standard in/out */
verbosw = 0; /* turn off -verbose listings */
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
icachesw = &wcachesw;
do_cache: ;
if (!(cp = *argp++) || *cp == '-')
icachesw = &wcachesw;
do_cache: ;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
int encoding;
if (!(cp = *argp++) || *cp == '-')
int encoding;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (encoding = smatch (cp, encodingswitches)) {
case AMBIGSW:
ambigsw (cp, encodingswitches);
done (1);
case UNKWNSW:
switch (encoding = smatch (cp, encodingswitches)) {
case AMBIGSW:
ambigsw (cp, encodingswitches);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown encoding algorithm", cp);
+ die("%s unknown encoding algorithm", cp);
case BASE64SW:
header_encoding = CE_BASE64;
break;
case BASE64SW:
header_encoding = CE_BASE64;
break;
header_encoding = CE_8BIT;
break;
default:
header_encoding = CE_8BIT;
break;
default:
- adios (NULL, "Internal error: algorithm %s", cp);
+ die("Internal error: algorithm %s", cp);
case MAXUNENCSW:
if (!(cp = *argp++) || *cp == '-')
case MAXUNENCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((maxunencoded = atoi(cp)) < 1)
if ((maxunencoded = atoi(cp)) < 1)
- adios (NULL, "Invalid argument for %s: %s", argp[-2], cp);
+ die("Invalid argument for %s: %s", argp[-2], cp);
- adios (NULL, "limit of -maxunencoded is 998");
+ die("limit of -maxunencoded is 998");
- adios (NULL, "only one composition file allowed");
+ die("only one composition file allowed");
/* Check if we have a file to process */
if (!compfile)
/* Check if we have a file to process */
if (!compfile)
- adios (NULL, "need to specify a %s composition file", invo_name);
+ die("need to specify a %s composition file", invo_name);
/*
* Process the composition file from standard input.
*/
if (compfile[0] == '-' && compfile[1] == '\0') {
if ((cp = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
/*
* Process the composition file from standard input.
*/
if (compfile[0] == '-' && compfile[1] == '\0') {
if ((cp = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
strncpy (infile, cp, sizeof(infile));
get_temp_dir());
}
strncpy (infile, cp, sizeof(infile));
/* copy standard input to temporary file */
while ((n = fread(buffer, 1, sizeof(buffer), stdin)) > 0) {
if (fwrite(buffer, 1, n, fp) != n) {
/* copy standard input to temporary file */
while ((n = fread(buffer, 1, sizeof(buffer), stdin)) > 0) {
if (fwrite(buffer, 1, n, fp) != n) {
- adios (NULL, "error copying to temporary file");
+ die("error copying to temporary file");
if (!ct) {
if (! (fp = fopen(infile, "r"))) {
if (!ct) {
if (! (fp = fopen(infile, "r"))) {
- adios(NULL, "Unable to open %s for reading", infile);
+ die("Unable to open %s for reading", infile);
}
while ((n = fread(buffer, 1, sizeof(buffer), fp)) > 0) {
if (fwrite(buffer, 1, n, stdout) != n) {
}
while ((n = fread(buffer, 1, sizeof(buffer), fp)) > 0) {
if (fwrite(buffer, 1, n, stdout) != n) {
- adios(NULL, "error copying %s to stdout", infile);
+ die("error copying %s to stdout", infile);
/* output MIME message to this temporary file */
if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) {
/* output MIME message to this temporary file */
if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
strncpy(outfile, cp, sizeof(outfile));
}
strncpy(outfile, cp, sizeof(outfile));
free (ct);
return NULL;
}
free (ct);
return NULL;
}
- adios (NULL, "draft shouldn't contain %s: field", name);
+ die("draft shouldn't contain %s: field", name);
}
/* ignore any Content-Type fields in the header */
}
/* ignore any Content-Type fields in the header */
if (convert) {
if (convert->filename &&
strcasecmp (convert->filename, filename)) {
if (convert) {
if (convert->filename &&
strcasecmp (convert->filename, filename)) {
- adios (NULL, "Multiple %s headers with different files"
+ die("Multiple %s headers with different files"
" not allowed", type);
} else {
convert->filename = mh_xstrdup(filename);
" not allowed", type);
} else {
convert->filename = mh_xstrdup(filename);
if (convert) {
if (convert->argstring &&
strcasecmp (convert->argstring, argstring)) {
if (convert) {
if (convert->argstring &&
strcasecmp (convert->argstring, argstring)) {
- adios (NULL, "Multiple %s headers with different "
+ die("Multiple %s headers with different "
"argstrings not allowed", type);
} else {
convert->argstring = mh_xstrdup(argstring);
"argstrings not allowed", type);
} else {
convert->argstring = mh_xstrdup(argstring);
case LENERR:
case FMTERR:
case LENERR:
case FMTERR:
- adios (NULL, "message format error in component #%d", compnum);
+ die("message format error in component #%d", compnum);
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
for (hp = ct->c_first_hf; hp != NULL; hp = hp->next) {
if (encode_rfc2047(hp->name, &hp->value, header_encoding, NULL)) {
for (hp = ct->c_first_hf; hp != NULL; hp = hp->next) {
if (encode_rfc2047(hp->name, &hp->value, header_encoding, NULL)) {
- adios(NULL, "Unable to encode header \"%s\"", hp->name);
+ die("Unable to encode header \"%s\"", hp->name);
/* Extract the type part (as a CT) from filename. */
cts = mh_xcalloc(2, sizeof *cts);
if (! (cts[0] = parse_mime (convert_head->filename))) {
/* Extract the type part (as a CT) from filename. */
cts = mh_xcalloc(2, sizeof *cts);
if (! (cts[0] = parse_mime (convert_head->filename))) {
- adios (NULL, "failed to parse %s", convert_head->filename);
+ die("failed to parse %s", convert_head->filename);
}
expand_pseudoheaders (cts[0], m, infile, convert_head);
}
expand_pseudoheaders (cts[0], m, infile, convert_head);
compose_content (ct, verbose);
if ((cp = strchr(prefix, 'a')) == NULL)
compose_content (ct, verbose);
if ((cp = strchr(prefix, 'a')) == NULL)
- adios (NULL, "internal error(4)");
+ die("internal error(4)");
/*
* If using EAI, force 8-bit charset.
/*
* If using EAI, force 8-bit charset.
(*cp)++;
} else {
if (*++cp == 0)
(*cp)++;
} else {
if (*++cp == 0)
- adios (NULL, "giving up trying to find a unique delimiter string");
+ die("giving up trying to find a unique delimiter string");
again_descr:
ct->c_descr = add (buffer + i + 1, ct->c_descr);
if (!fgetstr (buffer, sizeof(buffer) - 1, in))
again_descr:
ct->c_descr = add (buffer + i + 1, ct->c_descr);
if (!fgetstr (buffer, sizeof(buffer) - 1, in))
- adios (NULL, "end-of-file after %s: field in plaintext", DESCR_FIELD);
+ die("end-of-file after %s: field in plaintext", DESCR_FIELD);
switch (buffer[0]) {
case ' ':
case '\t':
switch (buffer[0]) {
case ' ':
case '\t':
goto again_descr;
case '#':
goto again_descr;
case '#':
- adios (NULL, "#-directive after %s: field in plaintext", DESCR_FIELD);
+ die("#-directive after %s: field in plaintext", DESCR_FIELD);
/* NOTREACHED */
default:
/* NOTREACHED */
default:
again_dispo:
ct->c_dispo = add (buffer + i + 1, ct->c_dispo);
if (!fgetstr (buffer, sizeof(buffer) - 1, in))
again_dispo:
ct->c_dispo = add (buffer + i + 1, ct->c_dispo);
if (!fgetstr (buffer, sizeof(buffer) - 1, in))
- adios (NULL, "end-of-file after %s: field in plaintext", DISPO_FIELD);
+ die("end-of-file after %s: field in plaintext", DISPO_FIELD);
switch (buffer[0]) {
case ' ':
case '\t':
switch (buffer[0]) {
case ' ':
case '\t':
goto again_dispo;
case '#':
goto again_dispo;
case '#':
- adios (NULL, "#-directive after %s: field in plaintext", DISPO_FIELD);
+ die("#-directive after %s: field in plaintext", DISPO_FIELD);
/* NOTREACHED */
default:
/* NOTREACHED */
default:
}
/* FALLTHRU */
case CT_MULTIPART:
}
/* FALLTHRU */
case CT_MULTIPART:
- adios (NULL, "it doesn't make sense to define an in-line %s content",
+ die("it doesn't make sense to define an in-line %s content",
ct->c_type == CT_MESSAGE ? "message" : "multipart");
/* NOTREACHED */
ct->c_type == CT_MESSAGE ? "message" : "multipart");
/* NOTREACHED */
*/
if (s2i->si_key) {
if (!ci->ci_subtype)
*/
if (s2i->si_key) {
if (!ci->ci_subtype)
- adios (NULL, "missing subtype in \"#%s\"", ci->ci_type);
+ die("missing subtype in \"#%s\"", ci->ci_type);
switch (ct->c_type = s2i->si_val) {
case CT_MULTIPART:
switch (ct->c_type = s2i->si_val) {
case CT_MULTIPART:
- adios (NULL, "use \"#begin ... #end\" instead of \"#%s/%s\"",
+ die("use \"#begin ... #end\" instead of \"#%s/%s\"",
ci->ci_type, ci->ci_subtype);
/* NOTREACHED */
case CT_MESSAGE:
if (!strcasecmp (ci->ci_subtype, "partial"))
ci->ci_type, ci->ci_subtype);
/* NOTREACHED */
case CT_MESSAGE:
if (!strcasecmp (ci->ci_subtype, "partial"))
- adios (NULL, "sorry, \"#%s/%s\" isn't supported",
+ die("sorry, \"#%s/%s\" isn't supported",
ci->ci_type, ci->ci_subtype);
if (!strcasecmp (ci->ci_subtype, "external-body"))
ci->ci_type, ci->ci_subtype);
if (!strcasecmp (ci->ci_subtype, "external-body"))
- adios (NULL, "use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"",
+ die("use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"",
ci->ci_type, ci->ci_subtype);
use_forw:
ci->ci_type, ci->ci_subtype);
use_forw:
- adios (NULL,
- "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"",
+ die( "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"",
ci->ci_type, ci->ci_subtype);
/* NOTREACHED */
ci->ci_type, ci->ci_subtype);
/* NOTREACHED */
- adios (NULL, "need external information for \"#@%s/%s\"",
+ die("need external information for \"#@%s/%s\"",
ci->ci_type, ci->ci_subtype);
p = ct;
ci->ci_type, ci->ci_subtype);
p = ct;
for (cp = ci->ci_magic + 1; isspace ((unsigned char) *cp); cp++)
continue;
if (!*cp)
for (cp = ci->ci_magic + 1; isspace ((unsigned char) *cp); cp++)
continue;
if (!*cp)
- adios (NULL, "empty pipe command for #%s directive", ci->ci_type);
+ die("empty pipe command for #%s directive", ci->ci_type);
cp = mh_xstrdup(cp);
free (ci->ci_magic);
ci->ci_magic = cp;
cp = mh_xstrdup(cp);
free (ci->ci_magic);
ci->ci_magic = cp;
- adios (NULL, "external definition not allowed for \"#%s\"", ci->ci_type);
+ die("external definition not allowed for \"#%s\"", ci->ci_type);
cp = *ap;
if (*cp == '+' || *cp == '@') {
if (folder)
cp = *ap;
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder per #forw directive");
+ die("only one folder per #forw directive");
folder = pluspath (cp);
}
}
folder = pluspath (cp);
}
}
folder = mh_xstrdup(getfolder(1));
if (!(mp = folder_read (folder, 0)))
folder = mh_xstrdup(getfolder(1));
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
for (ap = arguments; *ap; ap++) {
cp = *ap;
if (*cp != '+' && *cp != '@')
for (ap = arguments; *ap; ap++) {
cp = *ap;
if (*cp != '+' && *cp != '@')
if (user_content (in, buffer, &p, infilename) == DONE) {
if (!m->mp_parts)
if (user_content (in, buffer, &p, infilename) == DONE) {
if (!m->mp_parts)
- adios (NULL, "empty \"#begin ... #end\" sequence");
+ die("empty \"#begin ... #end\" sequence");
/*
* Unknown directive
*/
/*
* Unknown directive
*/
- adios (NULL, "unknown directive \"#%s\"", ci->ci_type);
+ die("unknown directive \"#%s\"", ci->ci_type);
return NOTOK; /* NOT REACHED */
}
return NOTOK; /* NOT REACHED */
}
char *tfile = NULL;
if (!(cp = ci->ci_magic))
char *tfile = NULL;
if (!(cp = ci->ci_magic))
- adios (NULL, "internal error(5)");
+ die("internal error(5)");
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
adios("mhbuildsbr", "unable to create temporary file in %s",
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
adios("mhbuildsbr", "unable to create temporary file in %s",
if (checkllinelen && !linelen &&
(gotlen > MAXLONGLINE + 1)) {
if (checkllinelen && !linelen &&
(gotlen > MAXLONGLINE + 1)) {
- adios(NULL, "Line in content exceeds maximum line limit (%d)",
+ die("Line in content exceeds maximum line limit (%d)",
char *s = output_params(len, ci->ci_first_pm, &len, mailbody);
if (!s)
char *s = output_params(len, ci->ci_first_pm, &len, mailbody);
if (!s)
- adios(NULL, "Internal error: failed outputting Content-Type "
+ die("Internal error: failed outputting Content-Type "
"parameters");
vp = add (s, vp);
"parameters");
vp = add (s, vp);
vp = concat (" ", ct->c_descr, NULL);
if (header_encoding != CE_8BIT) {
if (encode_rfc2047(DESCR_FIELD, &vp, header_encoding, NULL)) {
vp = concat (" ", ct->c_descr, NULL);
if (header_encoding != CE_8BIT) {
if (encode_rfc2047(DESCR_FIELD, &vp, header_encoding, NULL)) {
- adios(NULL, "Unable to encode %s header", DESCR_FIELD);
+ die("Unable to encode %s header", DESCR_FIELD);
}
}
add_header (ct, np, vp);
}
}
add_header (ct, np, vp);
case CE_QUOTED:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
case CE_QUOTED:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
- adios (NULL, "internal error, invalid encoding");
+ die("internal error, invalid encoding");
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "quoted-printable", "\n", NULL);
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "quoted-printable", "\n", NULL);
case CE_BASE64:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
case CE_BASE64:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
- adios (NULL, "internal error, invalid encoding");
+ die("internal error, invalid encoding");
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "base64", "\n", NULL);
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "base64", "\n", NULL);
case CE_BINARY:
if (ct->c_type == CT_MESSAGE)
case CE_BINARY:
if (ct->c_type == CT_MESSAGE)
- adios (NULL, "internal error, invalid encoding");
+ die("internal error, invalid encoding");
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "binary", "\n", NULL);
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "binary", "\n", NULL);
- adios (NULL, "unknown transfer encoding in content");
+ die("unknown transfer encoding in content");
PM pm;
if (! (type = mime_type(filename))) {
PM pm;
if (! (type = mime_type(filename))) {
- adios(NULL, "Unable to determine MIME type of \"%s\"", filename);
+ die("Unable to determine MIME type of \"%s\"", filename);
switch (ct->c_type = s2i->si_val) {
case CT_MULTIPART:
switch (ct->c_type = s2i->si_val) {
case CT_MULTIPART:
- adios (NULL, "multipart types must be specified by mhbuild directives");
+ die("multipart types must be specified by mhbuild directives");
/* NOTREACHED */
case CT_MESSAGE:
if (strcasecmp(ct->c_ctinfo.ci_subtype, "partial") == 0)
/* NOTREACHED */
case CT_MESSAGE:
if (strcasecmp(ct->c_ctinfo.ci_subtype, "partial") == 0)
- adios(NULL, "Sorry, %s/%s isn't supported", ct->c_ctinfo.ci_type,
+ die("Sorry, %s/%s isn't supported", ct->c_ctinfo.ci_type,
ct->c_ctinfo.ci_subtype);
if (strcasecmp(ct->c_ctinfo.ci_subtype, "external-body") == 0)
ct->c_ctinfo.ci_subtype);
if (strcasecmp(ct->c_ctinfo.ci_subtype, "external-body") == 0)
- adios(NULL, "external-body messages must be specified "
+ die("external-body messages must be specified "
"by mhbuild directives");
/* FALLTHRU */
"by mhbuild directives");
/* FALLTHRU */
if (contains8bit == 1 &&
strcasecmp (eightbitcharset, "US-ASCII") == 0) {
if (contains8bit == 1 &&
strcasecmp (eightbitcharset, "US-ASCII") == 0) {
- adios (NULL, "Text content contains 8 bit characters, but "
+ die("Text content contains 8 bit characters, but "
"character set is US-ASCII");
}
"character set is US-ASCII");
}
ct->c_subtype = TEXT_PLAIN;
if (get_ctinfo ("text/plain", ct, 0) == NOTOK) {
/* This never should fail, but just in case. */
ct->c_subtype = TEXT_PLAIN;
if (get_ctinfo ("text/plain", ct, 0) == NOTOK) {
/* This never should fail, but just in case. */
- adios (NULL, "unable to get content info for reply");
+ die("unable to get content info for reply");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof buf, "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof buf, "%s [+folder] [msgs] [switches]",
case DECODETEXTSW:
if (! (cp = *argp++) || *cp == '-') {
case DECODETEXTSW:
if (! (cp = *argp++) || *cp == '-') {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
if (! strcasecmp (cp, "8bit")) {
fx.decodetext = CE_8BIT;
}
if (! strcasecmp (cp, "8bit")) {
fx.decodetext = CE_8BIT;
} else if (! strcasecmp (cp, "binary")) {
fx.decodetext = CE_BINARY;
} else {
} else if (! strcasecmp (cp, "binary")) {
fx.decodetext = CE_BINARY;
} else {
- adios (NULL, "invalid argument to %s", argp[-2]);
+ die("invalid argument to %s", argp[-2]);
}
continue;
case NDECODETEXTSW:
}
continue;
case NDECODETEXTSW:
continue;
case DECODETYPESW:
if (! (cp = *argp++) || *cp == '-') {
continue;
case DECODETYPESW:
if (! (cp = *argp++) || *cp == '-') {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
fx.decodetypes = cp;
continue;
}
fx.decodetypes = cp;
continue;
continue;
case TEXTCHARSETSW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
continue;
case TEXTCHARSETSW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
fx.textcharset = cp;
continue;
}
fx.textcharset = cp;
continue;
continue;
case FIXTYPESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
continue;
case FIXTYPESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
if (! strncasecmp (cp, "multipart/", 10) ||
! strncasecmp (cp, "message/", 8))
}
if (! strncasecmp (cp, "multipart/", 10) ||
! strncasecmp (cp, "message/", 8))
- adios (NULL, "-fixtype %s not allowed", cp);
+ die("-fixtype %s not allowed", cp);
- adios (NULL, "-fixtype requires type/subtype");
+ die("-fixtype requires type/subtype");
if (fx.fixtypes == NULL) { fx.fixtypes = svector_create (10); }
svector_push_back (fx.fixtypes, cp);
continue;
if (fx.fixtypes == NULL) { fx.fixtypes = svector_create (10); }
svector_push_back (fx.fixtypes, cp);
continue;
continue;
case FILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
continue;
case FILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
file = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE);
continue;
case OUTFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
}
file = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE);
continue;
case OUTFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
outfile = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE);
continue;
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-') {
}
outfile = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE);
continue;
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-') {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
continue;
case NRPRCSW:
}
continue;
case NRPRCSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (*cp == '/') {
folder = pluspath (cp);
} else {
if (*cp == '/') {
}
if (file && msgs.size) {
}
if (file && msgs.size) {
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
using_stdin = 1;
if ((cp = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) {
using_stdin = 1;
if ((cp = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
} else {
free (file);
get_temp_dir());
} else {
free (file);
if (close (fd)) {
(void) m_unlink (file);
if (close (fd)) {
(void) m_unlink (file);
- adios (NULL, "failed to write temporary file");
+ die("failed to write temporary file");
/* read folder and create message structure */
if (! (mp = folder_read (folder, 1))) {
/* read folder and create message structure */
if (! (mp = folder_read (folder, 1))) {
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
}
/* check for empty folder */
if (mp->nummsg == 0) {
}
/* check for empty folder */
if (mp->nummsg == 0) {
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
}
/* parse all the message ranges/sequences and set SELECTED */
}
/* parse all the message ranges/sequences and set SELECTED */
/* outfp will be closed by the caller */
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, outfp)) ==
NULL) {
/* outfp will be closed by the caller */
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, outfp)) ==
NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
outfile = mh_xstrdup (tempfile);
} else {
get_temp_dir());
}
outfile = mh_xstrdup (tempfile);
} else {
- adios (NULL, "missing both input and output filenames\n");
+ die("missing both input and output filenames\n");
}
} /* else *outfp was defined by caller */
}
} /* else *outfp was defined by caller */
char *tempfile;
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, &file)) == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, &file)) == NULL) {
- adios (NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
tmp_decoded = mh_xstrdup (tempfile);
/* The following call will load ct->c_cefile.ce_file with the tmp
}
tmp_decoded = mh_xstrdup (tempfile);
/* The following call will load ct->c_cefile.ce_file with the tmp
char *tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL);
if (tempfile == NULL) {
char *tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL);
if (tempfile == NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
stripped_content_file = mh_xstrdup (tempfile);
get_temp_dir());
}
stripped_content_file = mh_xstrdup (tempfile);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW: {
char buf[128];
case HELPSW: {
char buf[128];
case REPLYSW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
case REPLYSW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (! strcasecmp (cp, "accept")) {
action = ACT_ACCEPT;
} else if (! strcasecmp (cp, "decline")) {
if (! strcasecmp (cp, "accept")) {
action = ACT_ACCEPT;
} else if (! strcasecmp (cp, "decline")) {
} else if (! strcasecmp (cp, "delegate")) {
action = ACT_DELEGATE;
} else {
} else if (! strcasecmp (cp, "delegate")) {
action = ACT_DELEGATE;
} else {
- adios (NULL, "Unknown action: %s", cp);
+ die("Unknown action: %s", cp);
case FORMSW:
if (! (form = *argp++) || *form == '-')
case FORMSW:
if (! (form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (! (format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (! (format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case INFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
form = NULL;
continue;
case INFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
infile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE);
continue;
case OUTFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
infile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE);
continue;
case OUTFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
outfile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE);
continue;
outfile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE);
continue;
insert = "Tentative: ";
break;
case ACT_DELEGATE:
insert = "Tentative: ";
break;
case ACT_DELEGATE:
- adios (NULL, "Delegate replies are not supported");
+ die("Delegate replies are not supported");
break;
case ACT_CANCEL:
insert = "Cancelled:";
break;
case ACT_CANCEL:
insert = "Cancelled:";
node->value = tmp;
} else {
/* Should never get here. */
node->value = tmp;
} else {
/* Should never get here. */
- adios (NULL, "Unknown action: %d", action);
+ die("Unknown action: %d", action);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npreferred >= NPREFS)
if (npreferred >= NPREFS)
- adios (NULL, "too many preferred types (starting with %s), %d max",
+ die("too many preferred types (starting with %s), %d max",
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
free (path ("./", TFOLDER));
if (file && msgs.size)
free (path ("./", TFOLDER));
if (file && msgs.size)
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
const char *url;
if (svc == NULL) {
const char *url;
if (svc == NULL) {
- adios(NULL, "missing -authservice switch");
+ die("missing -authservice switch");
- adios(NULL, "missing -user switch");
+ die("missing -user switch");
}
if (!mh_oauth_new(&ctx, svc)) {
}
if (!mh_oauth_new(&ctx, svc)) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
fn = mh_oauth_cred_fn(svc);
if ((url = mh_oauth_get_authorize_url(ctx)) == NULL) {
fn = mh_oauth_cred_fn(svc);
if ((url = mh_oauth_get_authorize_url(ctx)) == NULL) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
if (cred == NULL) {
inform("error exchanging code for OAuth2 token");
}
if (cred == NULL) {
inform("error exchanging code for OAuth2 token");
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
cred_file = lkfopendata(fn, "r+", &failed_to_lock);
}
cred_file = lkfopendata(fn, "r+", &failed_to_lock);
adios(fn, "oops");
}
if (!mh_oauth_cred_save(cred_file, cred, user)) {
adios(fn, "oops");
}
if (!mh_oauth_cred_save(cred_file, cred, user)) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
if (lkfclosedata(cred_file, fn) != 0) {
adios (fn, "oops");
}
if (lkfclosedata(cred_file, fn) != 0) {
adios (fn, "oops");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf(help, sizeof(help), "%s [switches]",
case HELPSW:
snprintf(help, sizeof(help), "%s [switches]",
case USERSW:
if (!(user = *argp++) || *user == '-')
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case AUTHSERVICESW:
if (!(svc = *argp++) || *svc == '-')
continue;
case AUTHSERVICESW:
if (!(svc = *argp++) || *svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case BROWSERSW:
if (!(browser = *argp++) || *browser == '-')
continue;
case BROWSERSW:
if (!(browser = *argp++) || *browser == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios(NULL, "extraneous arguments");
+ die("extraneous arguments");
}
if (saslmech && strcasecmp(saslmech, "xoauth2")) {
/* xoauth is assumed */
}
if (saslmech && strcasecmp(saslmech, "xoauth2")) {
/* xoauth is assumed */
- adios(NULL, "only -saslmech xoauth2 is supported");
+ die("only -saslmech xoauth2 is supported");
NMH_UNUSED(svc);
NMH_UNUSED(browser);
NMH_UNUSED(snoop);
NMH_UNUSED(svc);
NMH_UNUSED(browser);
NMH_UNUSED(snoop);
- adios(NULL, "not built with OAuth support");
+ die("not built with OAuth support");
*/
if (pipe(fdinput) < 0) {
*/
if (pipe(fdinput) < 0) {
- adios(NULL, "Unable to create input pipe");
+ die("Unable to create input pipe");
}
if (pipe(fdoutput) < 0) {
}
if (pipe(fdoutput) < 0) {
- adios(NULL, "Unable to create output pipe");
+ die("Unable to create output pipe");
- adios(NULL, "Unable to fork for filter writer process");
+ die("Unable to fork for filter writer process");
- adios(NULL, "Unable to fork format program");
+ die("Unable to fork format program");
- adios(NULL, "reading from formatproc");
+ die("reading from formatproc");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
cp, NTYPES);
types[ntype++] = cp;
continue;
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case FORMSW:
if (!(cp = *argp++) || *cp == '-')
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case FORMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
free(formsw);
formsw = mh_xstrdup(etcpath(cp));
continue;
free(formsw);
formsw = mh_xstrdup(etcpath(cp));
continue;
*/
case PROGSW:
if (!(progsw = *argp++) || *progsw == '-')
*/
case PROGSW:
if (!(progsw = *argp++) || *progsw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NPROGSW:
nomore++;
continue;
case NPROGSW:
nomore++;
case LENSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
case LENSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
int vecp;
if (showsw || storesw || cachesw)
int vecp;
if (showsw || storesw || cachesw)
- adios (NULL, "cannot use -build with -show, -store, -cache");
+ die("cannot use -build with -show, -store, -cache");
- adios (NULL, "need to specify a %s composition file", invo_name);
+ die("need to specify a %s composition file", invo_name);
- adios (NULL, "only one %s composition file at a time", invo_name);
+ die("only one %s composition file at a time", invo_name);
vecp = 0;
vec[vecp++] = "mhbuild";
vecp = 0;
vec[vecp++] = "mhbuild";
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
* at a time.
*/
if (showsw + listsw + storesw + cachesw > 1)
* at a time.
*/
if (showsw + listsw + storesw + cachesw > 1)
- adios (NULL, "can only use one of -show, -list, -store, -cache at same time");
+ die("can only use one of -show, -list, -store, -cache at same time");
/* If no action is specified, assume -show */
if (!listsw && !showsw && !storesw && !cachesw)
/* If no action is specified, assume -show */
if (!listsw && !showsw && !storesw && !cachesw)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [profile-components] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [profile-components] [switches]",
case LENERR:
case FMTERR:
case LENERR:
case FMTERR:
- adios (NULL, "message format error in component #%d", compnum);
+ die("message format error in component #%d", compnum);
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
}
/* break out of the loop */
}
/* break out of the loop */
adios ("failed", "fread");
case OK:
adios ("failed", "fread");
case OK:
- adios (NULL, "unexpected EOF from fread");
+ die("unexpected EOF from fread");
default:
bp += cc, size -= cc;
default:
bp += cc, size -= cc;
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
} else {
get_temp_dir());
}
} else {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
}
if ((len = ct->c_end - ct->c_begin) < 0)
}
if ((len = ct->c_end - ct->c_begin) < 0)
- adios (NULL, "internal error(1)");
+ die("internal error(1)");
buffer = mh_xmalloc (len + 1);
buffer = mh_xmalloc (len + 1);
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
} else {
get_temp_dir());
}
} else {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
}
if ((len = ct->c_end - ct->c_begin) < 0)
}
if ((len = ct->c_end - ct->c_begin) < 0)
- adios (NULL, "internal error(2)");
+ die("internal error(2)");
if (! ct->c_fp) {
if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
if (! ct->c_fp) {
if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
} else {
get_temp_dir());
}
} else {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
}
if ((len = ct->c_end - ct->c_begin) < 0)
}
if ((len = ct->c_end - ct->c_begin) < 0)
- adios (NULL, "internal error(3)");
+ die("internal error(3)");
if (! ct->c_fp) {
if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
if (! ct->c_fp) {
if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
else {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
else {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
else {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
else {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
if (! pm->pm_charset) {
pm->pm_charset = mh_xstrdup(write_charset_8bit());
if (strcasecmp(pm->pm_charset, "US-ASCII") == 0)
if (! pm->pm_charset) {
pm->pm_charset = mh_xstrdup(write_charset_8bit());
if (strcasecmp(pm->pm_charset, "US-ASCII") == 0)
- adios(NULL, "8-bit characters in parameter \"%s\", but "
+ die("8-bit characters in parameter \"%s\", but "
"local character set is US-ASCII", pm->pm_name);
}
if (! pm->pm_lang)
"local character set is US-ASCII", pm->pm_name);
}
if (! pm->pm_lang)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/*
* We need to make sure there is message status space
/*
* We need to make sure there is message status space
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
} else if (mp->lowoff > 1) {
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
} else if (mp->lowoff > 1) {
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npreferred >= NPREFS)
if (npreferred >= NPREFS)
- adios (NULL, "too many preferred types (starting with %s), %d max",
+ die("too many preferred types (starting with %s), %d max",
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case FORMSW:
if (!(cp = *argp++) || *cp == '-')
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case FORMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
free(formsw);
formsw = mh_xstrdup(etcpath(cp));
continue;
free(formsw);
formsw = mh_xstrdup(etcpath(cp));
continue;
case HEADFORMSW:
if (!(headerform = *argp++) || *headerform == '-')
case HEADFORMSW:
if (!(headerform = *argp++) || *headerform == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MARKFORMSW:
if (!(markerform = *argp++) || *markerform == '-')
continue;
case MARKFORMSW:
if (!(markerform = *argp++) || *markerform == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
*/
case PROGSW:
if (!(progsw = *argp++) || *progsw == '-')
*/
case PROGSW:
if (!(progsw = *argp++) || *progsw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NPROGSW:
nomore++;
continue;
case NPROGSW:
nomore++;
case LENSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
case LENSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
free (path ("./", TFOLDER));
if (file && msgs.size)
free (path ("./", TFOLDER));
if (file && msgs.size)
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
}
if ((tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) {
}
if ((tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
dest = mh_xstrdup(tempfile);
get_temp_dir());
}
dest = mh_xstrdup(tempfile);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npreferred >= NPREFS)
if (npreferred >= NPREFS)
- adios (NULL, "too many preferred types (starting with %s), %d max",
+ die("too many preferred types (starting with %s), %d max",
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case OUTFILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case OUTFILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
outfile = *cp == '-' ? cp : path (cp, TFILE);
continue;
outfile = *cp == '-' ? cp : path (cp, TFILE);
continue;
continue;
case CLOBBERSW:
if (!(cp = *argp++) || *cp == '-')
continue;
case CLOBBERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
clobbersw = cp;
continue;
case DEBUGSW:
clobbersw = cp;
continue;
case DEBUGSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
free (path ("./", TFOLDER));
if (file && msgs.size)
free (path ("./", TFOLDER));
if (file && msgs.size)
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* Store content in temporary file for now */
if ((tmpfilenam = m_mktemp(invo_name, NULL, NULL)) == NULL) {
/* Store content in temporary file for now */
if ((tmpfilenam = m_mktemp(invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ct->c_storage = mh_xstrdup(tmpfilenam);
get_temp_dir());
}
ct->c_storage = mh_xstrdup(tmpfilenam);
return NMH_CLOBBER_NEVER;
}
return NMH_CLOBBER_NEVER;
}
- adios (NULL, "invalid argument, %s, to clobber", value);
+ die("invalid argument, %s, to clobber", value);
case DIRECTORYSW:
/* Allow the directory to start with '-'. */
if ((cp = *argp++) == NULL) {
case DIRECTORYSW:
/* Allow the directory to start with '-'. */
if ((cp = *argp++) == NULL) {
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
*directory = cp;
continue;
}
*directory = cp;
continue;
case PREFIXSW:
/* Allow the prefix to start with '-'. */
if ((cp = *argp++) == NULL) {
case PREFIXSW:
/* Allow the prefix to start with '-'. */
if ((cp = *argp++) == NULL) {
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
*prefix = cp;
continue;
}
*prefix = cp;
continue;
case SUFFIXSW:
/* Allow the suffix to start with '-'. */
if ((cp = *argp++) == NULL) {
case SUFFIXSW:
/* Allow the suffix to start with '-'. */
if ((cp = *argp++) == NULL) {
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
*suffix = cp;
continue;
}
*suffix = cp;
continue;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [users ...]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [users ...]",
case NOTESW:
if (!(cp = *argp++) || *cp == '-')
case NOTESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
notifysw |= donote (cp, 1);
continue;
case NNOTESW:
if (!(cp = *argp++) || *cp == '-')
notifysw |= donote (cp, 1);
continue;
case NNOTESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
notifysw &= ~donote (cp, 0);
continue;
case HOSTSW:
if (!(host = *argp++) || *host == '-')
notifysw &= ~donote (cp, 0);
continue;
case HOSTSW:
if (!(host = *argp++) || *host == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(cp = *argp++) || *cp == '-')
continue;
case USERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "you can only check %d users at a time", MAXVEC-1);
+ die("you can only check %d users at a time", MAXVEC-1);
user = vec[vecp++] = cp;
continue;
user = vec[vecp++] = cp;
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case INITTLSSW:
continue;
case INITTLSSW:
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
#endif
continue;
case PROXYSW:
if (!(proxy = *argp++) || *proxy == '-')
#endif
continue;
case PROXYSW:
if (!(proxy = *argp++) || *proxy == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
}
}
if (vecp >= MAXVEC-1)
continue;
}
}
if (vecp >= MAXVEC-1)
- adios (NULL, "you can only check %d users at a time", MAXVEC-1);
+ die("you can only check %d users at a time", MAXVEC-1);
if (!geteuid() || NULL == (home = getenv("HOME"))) {
pw = getpwnam (user);
if (pw == NULL)
if (!geteuid() || NULL == (home = getenv("HOME"))) {
pw = getpwnam (user);
if (pw == NULL)
- adios (NULL, "unable to get information about user");
+ die("unable to get information about user");
home = pw->pw_dir;
}
status = checkmail (user, home, datesw, notifysw, 1);
home = pw->pw_dir;
}
status = checkmail (user, home, datesw, notifysw, 1);
ambigsw (cp, ntswitches);
done (1);
case UNKWNSW:
ambigsw (cp, ntswitches);
done (1);
case UNKWNSW:
- adios (NULL, "-%snotify %s unknown", ntflag ? "" : "no", cp);
+ die("-%snotify %s unknown", ntflag ? "" : "no", cp);
case NALLSW:
return NT_ALL;
case NALLSW:
return NT_ALL;
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
- adios (NULL, "no blank lines are permitted in %s", seqfile);
+ die("no blank lines are permitted in %s", seqfile);
break;
case FILEEOF:
break;
default:
break;
case FILEEOF:
break;
default:
- adios (NULL, "%s is poorly formatted", seqfile);
+ die("%s is poorly formatted", seqfile);
}
break; /* break from for loop */
}
}
break; /* break from for loop */
}
} else {
fp = fopen(folders, "r");
if (fp == NULL) {
} else {
fp = fopen(folders, "r");
if (fp == NULL) {
- adios(NULL, "failed to read %s", folders);
+ die("failed to read %s", folders);
}
while (vfgets(fp, &line) == OK) {
len = strlen(line) - 1;
}
while (vfgets(fp, &line) == OK) {
len = strlen(line) - 1;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (help, sizeof(help), "%s [switches] [sequences]",
case HELPSW:
snprintf (help, sizeof(help), "%s [switches] [sequences]",
case FOLDERSSW:
if (!(folders = *argp++) || *folders == '-')
case FOLDERSSW:
if (!(folders = *argp++) || *folders == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MODESW:
if (!(invo_name = *argp++) || *invo_name == '-')
continue;
case MODESW:
if (!(invo_name = *argp++) || *invo_name == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
invo_name = r1bindex(invo_name, '/');
continue;
}
invo_name = r1bindex(invo_name, '/');
continue;
}
/* no sequence arguments; use unseen */
unseen = context_find(usequence);
if (unseen == NULL || unseen[0] == '\0') {
/* no sequence arguments; use unseen */
unseen = context_find(usequence);
if (unseen == NULL || unseen[0] == '\0') {
- adios(NULL, "must specify sequences or set %s", usequence);
+ die("must specify sequences or set %s", usequence);
}
for (ap = brkstring(unseen, " ", "\n"); *ap; ap++) {
svector_push_back (sequences, *ap);
}
for (ap = brkstring(unseen, " ", "\n"); *ap; ap++) {
svector_push_back (sequences, *ap);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(file = *argp++) || *file == '-')
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
listsw = 0; /* HACK */
done (1);
case UNKWNSW:
listsw = 0; /* HACK */
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
vec[vecp++] = --cp;
pattern:
if (!(cp = *argp++))/* allow -xyz arguments */
vec[vecp++] = --cp;
pattern:
if (!(cp = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
case OTHRSW:
vec[vecp++] = cp;
continue;
case OTHRSW:
- adios (NULL, "internal error!");
+ die("internal error!");
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (!seq_nameok (cp))
done (1);
if (!seq_nameok (cp))
done (1);
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
listsw = !seqp;
if (publicsw == 1 && is_readonly(mp))
listsw = !seqp;
if (publicsw == 1 && is_readonly(mp))
- adios (NULL, "folder %s is read-only, so -public not allowed", folder);
+ die("folder %s is read-only, so -public not allowed", folder);
if (!pcompile (vec, NULL))
done (1);
if (!pcompile (vec, NULL))
done (1);
}
if (nums.size >= mp->numsel)
}
if (nums.size >= mp->numsel)
- adios (NULL, "no messages match specification");
+ die("no messages match specification");
/*
* So, what's happening here?
/*
* So, what's happening here?
*/
if (!(mp2 = folder_read (folder, 1)))
*/
if (!(mp2 = folder_read (folder, 1)))
- adios (NULL, "unable to reread folder %s", folder);
+ die("unable to reread folder %s", folder);
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert (mp2, msgs.msgs[msgnum]))
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert (mp2, msgs.msgs[msgnum]))
- adios (NULL, "internal error -- you lose");
+ die("internal error -- you lose");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
case LIBSW:
if (!(cp = *argp++) || *cp == '-')
case LIBSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
/* create a minimal context */
if (context_foil (cp) == -1)
done (1);
/* create a minimal context */
if (context_foil (cp) == -1)
done (1);
case ALIASW:
if (!(cp = *argp++) || *cp == '-')
case ALIASW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((state = alias (cp)) != AK_OK)
if ((state = alias (cp)) != AK_OK)
- adios (NULL, "aliasing error in %s - %s",
+ die("aliasing error in %s - %s",
cp, akerror (state));
continue;
cp, akerror (state));
continue;
case FILTSW:
if (!(filter = *argp++) || *filter == '-')
case FILTSW:
if (!(filter = *argp++) || *filter == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
mime = 0;
continue;
case NFILTSW:
mime = 0;
continue;
case NFILTSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi (cp)) < 10)
if ((outputlinelen = atoi (cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case ANNOSW:
if (!(cp = *argp++) || *cp == '-')
continue;
case ANNOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((pfd = atoi (cp)) <= 2)
if ((pfd = atoi (cp)) <= 2)
- adios (NULL, "bad argument %s %s", argp[-2], cp);
+ die("bad argument %s %s", argp[-2], cp);
continue;
case CLIESW:
if (!(clientsw = *argp++) || *clientsw == '-')
continue;
case CLIESW:
if (!(clientsw = *argp++) || *clientsw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SERVSW:
if (!(serversw = *argp++) || *serversw == '-')
continue;
case SERVSW:
if (!(serversw = *argp++) || *serversw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
snoop++;
continue;
case SNOOPSW:
snoop++;
case PARTSW:
if (!(partno = *argp++) || *partno == '-')
case PARTSW:
if (!(partno = *argp++) || *partno == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case AUTHSERVICESW:
if (!(auth_svc = *argp++) || *auth_svc == '-')
continue;
case AUTHSERVICESW:
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
int i;
if (!(cp = *argp++) || *cp == '-')
int i;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
for (i = 0; oauthswitches[i].profname != NULL; i++) {
if (oauthswitches[i].switchnum == swnum) {
for (i = 0; oauthswitches[i].profname != NULL; i++) {
if (oauthswitches[i].switchnum == swnum) {
}
if (oauthswitches[i].profname == NULL)
}
if (oauthswitches[i].profname == NULL)
- adios (NULL, "internal error: cannot map switch %s "
+ die("internal error: cannot map switch %s "
"to profile entry", argp[-2]);
oauth_flag++;
"to profile entry", argp[-2]);
oauth_flag++;
case USERSW:
if (!(user = *argp++) || *user == '-')
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case FILEPROCSW:
if (!(cp = *argp++) || *cp == '-')
case FILEPROCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fileproc = cp;
continue;
case MHLPROCSW:
if (!(cp = *argp++) || *cp == '-')
fileproc = cp;
continue;
case MHLPROCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
mhlproc = cp;
continue;
case MTSSM:
if (!(cp = *argp++) || *cp == '-')
mhlproc = cp;
continue;
case MTSSM:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
sendmail = cp;
continue;
case MTSSW:
if (!(cp = *argp++) || *cp == '-')
sendmail = cp;
continue;
case MTSSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
save_mts_method (cp);
continue;
case CREDENTIALSSW: {
if (!(cp = *argp++) || *cp == '-')
save_mts_method (cp);
continue;
case CREDENTIALSSW: {
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
add_profile_entry ("credentials", cp);
continue;
}
case MESSAGEIDSW:
if (!(cp = *argp++) || *cp == '-')
add_profile_entry ("credentials", cp);
continue;
}
case MESSAGEIDSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (save_message_id_style (cp) != 0)
if (save_message_id_style (cp) != 0)
- adios (NULL, "unsupported messageid \"%s\"", cp);
+ die("unsupported messageid \"%s\"", cp);
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
msg = cp;
}
alias (AliasFile);
if (!msg)
msg = cp;
}
alias (AliasFile);
if (!msg)
- adios (NULL, "usage: %s [switches] file", invo_name);
+ die("usage: %s [switches] file", invo_name);
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
if ((in = fopen (msg, "r")) == NULL)
adios (msg, "unable to open");
if ((in = fopen (msg, "r")) == NULL)
adios (msg, "unable to open");
} else {
char *cp = m_mktemp2(NULL, invo_name, NULL, &out);
if (cp == NULL) {
} else {
char *cp = m_mktemp2(NULL, invo_name, NULL, &out);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
strncpy(tmpfil, cp, sizeof(tmpfil));
get_temp_dir());
}
strncpy(tmpfil, cp, sizeof(tmpfil));
case LENERR:
case FMTERR:
case LENERR:
case FMTERR:
- adios (NULL, "message format error in component #%d", compnum);
+ die("message format error in component #%d", compnum);
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
char sbuf[128];
if (auth_svc == NULL) {
char sbuf[128];
if (auth_svc == NULL) {
- adios(NULL, "No authentication service given with -authservice");
+ die("No authentication service given with -authservice");
}
for (i = 0; oauthswitches[i].profname != NULL; i++) {
}
for (i = 0; oauthswitches[i].profname != NULL; i++) {
aliases and put them in Bcc:, but then
they'd have the Blind-Carbon-Copy
indication. */
aliases and put them in Bcc:, but then
they'd have the Blind-Carbon-Copy
indication. */
- adios (NULL,
- "blind lists not compatible with"
+ die( "blind lists not compatible with"
- adios (NULL, "re-format message and try again");
+ die("re-format message and try again");
- adios (NULL, "no addressees");
return;
if (fccind >= FCCS)
return;
if (fccind >= FCCS)
- adios (NULL, "too many %ss", hdr->value);
+ die("too many %ss", hdr->value);
fccfold[fccind++] = mh_xstrdup(cp);
}
fccfold[fccind++] = mh_xstrdup(cp);
}
char *tfile = NULL, *program;
if ((tfile = m_mktemp2(NULL, "bccs", NULL, &out)) == NULL) {
char *tfile = NULL, *program;
if ((tfile = m_mktemp2(NULL, "bccs", NULL, &out)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (bccfil, tfile, sizeof(bccfil));
}
strncpy (bccfil, tfile, sizeof(bccfil));
* prefix and check again.
*/
if ((cp = strchr(prefix, 'a')) == NULL)
* prefix and check again.
*/
if ((cp = strchr(prefix, 'a')) == NULL)
- adios (NULL, "lost prefix start");
+ die("lost prefix start");
while (find_prefix () == NOTOK) {
if (*cp < 'z')
(*cp)++;
else if (*++cp == 0)
while (find_prefix () == NOTOK) {
if (*cp < 'z')
(*cp)++;
else if (*++cp == 0)
- adios (NULL, "can't find a unique delimiter string");
+ die("can't find a unique delimiter string");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buffer, sizeof(buffer), "%s [switches] file",
case HELPSW:
snprintf (buffer, sizeof(buffer), "%s [switches] file",
case ERASESW:
if (!(erasep = *argp++) || *erasep == '-')
case ERASESW:
if (!(erasep = *argp++) || *erasep == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case KILLSW:
if (!(killp = *argp++) || *killp == '-')
continue;
case KILLSW:
if (!(killp = *argp++) || *killp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "usage: %s [switches] file", invo_name);
+ die("usage: %s [switches] file", invo_name);
if ((in = fopen (drft, "r")) == NULL)
adios (drft, "unable to open");
if ((tmpfil = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) {
if ((in = fopen (drft, "r")) == NULL)
adios (drft, "unable to open");
if ((tmpfil = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
- adios (NULL, "skeleton is poorly formatted");
+ die("skeleton is poorly formatted");
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "usage: %s [switches] [switches for postproc] address ...",
+ die("usage: %s [switches] [switches for postproc] address ...",
invo_name);
umask (~m_gmprot ());
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
invo_name);
umask (~m_gmprot ());
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (tmpfil, tfile, sizeof(tmpfil));
}
strncpy (tmpfil, tfile, sizeof(tmpfil));
fseek (fp, 0L, SEEK_SET);
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
fseek (fp, 0L, SEEK_SET);
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (drft, tfile, sizeof(tmpfil));
}
strncpy (drft, tfile, sizeof(tmpfil));
- adios (NULL, "m_getfld2() returned %d", state);
+ die("m_getfld2() returned %d", state);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
- adios (NULL, "%s [switches] file", invo_name);
+ die("%s [switches] file", invo_name);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument name to %s", argp[-2]);
+ die("missing argument name to %s", argp[-2]);
svector_push_back (seqs, cp);
seqp++;
svector_push_back (seqs, cp);
seqp++;
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
folder = pluspath (cp);
} else {
- adios (NULL, "usage: %s [+folder] [switches]", invo_name);
+ die("usage: %s [+folder] [switches]", invo_name);
if (errno != ENOENT)
adios (maildir, "error on folder");
if (!create)
if (errno != ENOENT)
adios (maildir, "error on folder");
if (!create)
- adios (NULL, "folder %s doesn't exist", maildir);
+ die("folder %s doesn't exist", maildir);
- adios (NULL, "unable to create folder %s", maildir);
+ die("unable to create folder %s", maildir);
}
if (chdir (maildir) == NOTOK)
}
if (chdir (maildir) == NOTOK)
/* create a temporary file */
tmpfilenam = m_mktemp (invo_name, &fd, NULL);
if (tmpfilenam == NULL) {
/* create a temporary file */
tmpfilenam = m_mktemp (invo_name, &fd, NULL);
if (tmpfilenam == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
chmod (tmpfilenam, m_gmprot());
}
chmod (tmpfilenam, m_gmprot());
* read folder and create message structure
*/
if (!(mp = folder_read (folder, 1)))
* read folder and create message structure
*/
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/*
* Link message into folder, and possibly add
/*
* Link message into folder, and possibly add
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi(cp);
continue;
case NLSW:
width = atoi(cp);
continue;
case NLSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [msgs] [switches] +folder ...",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [msgs] [switches] +folder ...",
- adios (NULL, "only one source folder at a time!");
+ die("only one source folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
folder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DRAFTSW:
if (filep > NFOLDERS)
folder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DRAFTSW:
if (filep > NFOLDERS)
- adios (NULL, "only %d files allowed!", NFOLDERS);
+ die("only %d files allowed!", NFOLDERS);
isdf = 0;
files[filep++] = mh_xstrdup(m_draft(NULL, NULL, 1, &isdf));
continue;
case FILESW:
if (filep > NFOLDERS)
isdf = 0;
files[filep++] = mh_xstrdup(m_draft(NULL, NULL, 1, &isdf));
continue;
case FILESW:
if (filep > NFOLDERS)
- adios (NULL, "only %d files allowed!", NFOLDERS);
+ die("only %d files allowed!", NFOLDERS);
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
files[filep++] = path (cp, TFILE);
continue;
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-')
files[filep++] = path (cp, TFILE);
continue;
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NRPRCSW:
rmmproc = NULL;
continue;
case NRPRCSW:
rmmproc = NULL;
}
if (*cp == '+' || *cp == '@') {
if (foldp > NFOLDERS)
}
if (*cp == '+' || *cp == '@') {
if (foldp > NFOLDERS)
- adios (NULL, "only %d folders allowed!", NFOLDERS);
+ die("only %d folders allowed!", NFOLDERS);
folders[foldp++].f_name =
pluspath (cp);
} else
folders[foldp++].f_name =
pluspath (cp);
} else
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (foldp == 0)
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (foldp == 0)
- adios (NULL, "no folder specified");
+ die("no folder specified");
/*
* We are refiling a file to the folders
*/
if (filep > 0) {
if (folder || msgs.size)
/*
* We are refiling a file to the folders
*/
if (filep > 0) {
if (folder || msgs.size)
- adios (NULL, "use -file or some messages, not both");
+ die("use -file or some messages, not both");
opnfolds (NULL, folders, foldp);
for (i = 0; i < filep; i++)
if (m_file (0, files[i], 0, folders, foldp, preserve, 0))
opnfolds (NULL, folders, foldp);
for (i = 0; i < filep; i++)
if (m_file (0, files[i], 0, folders, foldp, preserve, 0))
/* read source folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read source folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse the message range/sequence/name and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (chdir (nmaildir) == NOTOK)
adios (nmaildir, "unable to change directory to");
if (!(mp = folder_read (fp->f_name, 1)))
if (chdir (nmaildir) == NOTOK)
adios (nmaildir, "unable to change directory to");
if (!(mp = folder_read (fp->f_name, 1)))
- adios (NULL, "unable to read folder %s", fp->f_name);
+ die("unable to read folder %s", fp->f_name);
mp->curmsg = 0;
fp->f_mp = mp;
mp->curmsg = 0;
fp->f_mp = mp;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s: [+folder] [msg] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s: [+folder] [msg] [switches]",
case CCSW:
if (!(cp = *argp++) || *cp == '-')
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
docc (cp, 1);
continue;
case NCCSW:
if (!(cp = *argp++) || *cp == '-')
docc (cp, 1);
continue;
case NCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
docc (cp, 0);
continue;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
docc (cp, 0);
continue;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
nedit = 0;
continue;
case NEDITSW:
size_t i;
if (!(type = *argp++)) {
size_t i;
if (!(type = *argp++)) {
- adios (NULL, "missing type argument to %s", argp[-2]);
+ die("missing type argument to %s", argp[-2]);
- adios (NULL, "missing argstring argument to %s",
+ die("missing argstring argument to %s",
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nwhat = 0;
continue;
case BILDSW:
nwhat = 0;
continue;
case BILDSW:
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dp = NULL;
if (*cp == '@')
cp = dp = path (cp + 1, TSUBCWF);
dp = NULL;
if (*cp == '@')
cp = dp = path (cp + 1, TSUBCWF);
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FILTSW:
if (!(cp = *argp++) || *cp == '-')
file = path (cp, TFILE);
continue;
case FILTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
mime = 0;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
filter = mh_xstrdup(etcpath(cp));
mime = 0;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi (cp)) < 10)
if ((outputlinelen = atoi (cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case DFOLDSW:
if (dfolder)
continue;
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
continue;
case NDFLDSW:
dfolder = NULL;
case FMTPROCSW:
if (!(formatproc = *argp++) || *formatproc == '-')
case FMTPROCSW:
if (!(formatproc = *argp++) || *formatproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fmtproc = 1;
continue;
case NFMTPROCSW:
fmtproc = 1;
continue;
case NFMTPROCSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (msg)
folder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msg || folder))
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msg || folder))
- adios (NULL, "can't mix files and folders/msgs");
+ die("can't mix files and folders/msgs");
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
seq_setprev (mp); /* set the previous-sequence */
if (mp->numsel > 1)
seq_setprev (mp); /* set the previous-sequence */
if (mp->numsel > 1)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
context_replace (pfolder, folder); /* update current folder */
seq_setcur (mp, mp->lowsel); /* update current message */
context_replace (pfolder, folder); /* update current folder */
seq_setcur (mp, mp->lowsel); /* update current message */
ambigsw (cp, ccswitches);
done (1);
case UNKWNSW:
ambigsw (cp, ccswitches);
done (1);
case UNKWNSW:
- adios (NULL, "-%scc %s unknown", ccflag ? "" : "no", cp);
+ die("-%scc %s unknown", ccflag ? "" : "no", cp);
case CTOSW:
ccto = ccflag;
case CTOSW:
ccto = ccflag;
- adios (NULL, "m_getfld2() returned %d", state);
+ die("m_getfld2() returned %d", state);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
folder = pluspath (cp);
} else {
- adios (NULL, "usage: %s [+folder] [switches]", invo_name);
+ die("usage: %s [+folder] [switches]", invo_name);
}
fp = m_mailpath(folder);
if (!strcmp(fp, pwd()))
}
fp = m_mailpath(folder);
if (!strcmp(fp, pwd()))
- adios (NULL, "sorry, you can't remove the current working directory");
+ die("sorry, you can't remove the current working directory");
free(fp);
if (interactive == -1)
free(fp);
if (interactive == -1)
}
if ((dd = opendir (".")) == NULL)
}
if ((dd = opendir (".")) == NULL)
- adios (NULL, "unable to read folder +%s", folder);
+ die("unable to read folder +%s", folder);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-')
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NRPRCSW:
rmmproc = NULL;
continue;
case NRPRCSW:
rmmproc = NULL;
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
case REVSW:
width = atoi (cp);
continue;
case REVSW:
case FILESW:
if (!(cp = *argp++) || (cp[0] == '-' && cp[1]))
case FILESW:
if (!(cp = *argp++) || (cp[0] == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (strcmp (file = cp, "-"))
file = path (cp, TFILE);
continue;
if (strcmp (file = cp, "-"))
file = path (cp, TFILE);
continue;
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
*/
if (file) {
if (msgs.size)
*/
if (file) {
if (msgs.size)
- adios (NULL, "\"msgs\" not allowed with -file");
+ die("\"msgs\" not allowed with -file");
- adios (NULL, "\"+folder\" not allowed with -file");
+ die("\"+folder\" not allowed with -file");
/* check if "file" is really stdin */
if (strcmp (file, "-") == 0) {
/* check if "file" is really stdin */
if (strcmp (file, "-") == 0) {
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
- adios (NULL, "scan() botch (%d)", state);
+ die("scan() botch (%d)", state);
case SCNEOF:
inform("message %d: empty", msgnum);
case SCNEOF:
inform("message %d: empty", msgnum);
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [file] [switches]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [file] [switches]", invo_name);
case DFOLDSW:
if (dfolder)
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (!(cp = *argp++) || *cp == '-')
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgs[msgp++] = cp;
continue;
case NDFLDSW:
msgs[msgp++] = cp;
continue;
case NDFLDSW:
case SPLITSW:
if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1)
case SPLITSW:
if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1)
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case USERSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
case USERSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
user = cp;
continue;
vec[vecp++] = cp;
user = cp;
continue;
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
#endif
continue;
case SASLMECHSW:
if (!(saslmech = *argp) || *saslmech == '-')
#endif
continue;
case SASLMECHSW:
if (!(saslmech = *argp) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-1]);
+ die("missing argument to %s", argp[-1]);
/* FALLTHRU */
case ALIASW:
/* FALLTHRU */
case ALIASW:
case MESSAGEIDSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
case MESSAGEIDSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
}
vec[vecp++] = cp;
continue;
}
/* read folder and create message structure */
if (!(mp = folder_read (dfolder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (dfolder, 1)))
- adios (NULL, "unable to read folder %s", dfolder);
+ die("unable to read folder %s", dfolder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", dfolder);
+ die("no messages in %s", dfolder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgp; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgp; msgnum++)
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
adios (distfile, "unable to link %s to", altmsg);
free (distfile);
if ((cp = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
adios (distfile, "unable to link %s to", altmsg);
free (distfile);
if ((cp = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
distfile = mh_xstrdup(cp);
get_temp_dir());
}
distfile = mh_xstrdup(cp);
#ifdef OAUTH_SUPPORT
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
#ifdef OAUTH_SUPPORT
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
if (pushsw && unique) {
char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
if (cp == NULL) {
if (pushsw && unique) {
char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK)
adios (file, "unable to rename %s to", drft);
}
if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK)
adios (file, "unable to rename %s to", drft);
#ifdef OAUTH_SUPPORT
const char *errmsg;
if (setup_oauth_params(vec, nvecsp, auth_svc, &errmsg) != OK) {
#ifdef OAUTH_SUPPORT
const char *errmsg;
if (setup_oauth_params(vec, nvecsp, auth_svc, &errmsg) != OK) {
- adios(NULL, "%s", errmsg);
- adios(NULL, "send built without OAUTH_SUPPORT, "
+ die("send built without OAUTH_SUPPORT, "
"so auth_svc %s is not supported", auth_svc);
#endif /* OAUTH_SUPPORT */
}
"so auth_svc %s is not supported", auth_svc);
#endif /* OAUTH_SUPPORT */
}
case LENERR:
case FMTERR:
case LENERR:
case FMTERR:
- adios (NULL, "message format error in component #%d", compnum);
+ die("message format error in component #%d", compnum);
- adios (NULL, "getfld () returned %d", state);
+ die("getfld () returned %d", state);
}
break;
}
m_getfld_state_destroy (&gstate);
if (cp == NULL)
}
break;
}
m_getfld_state_destroy (&gstate);
if (cp == NULL)
- adios (NULL, "headers missing from draft");
+ die("headers missing from draft");
char *cp = m_mktemp2(drft, invo_name, NULL, &out);
if (cp == NULL) {
char *cp = m_mktemp2(drft, invo_name, NULL, &out);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
strncpy(tmpdrf, cp, sizeof(tmpdrf));
}
strncpy(tmpdrf, cp, sizeof(tmpdrf));
if (!fgets (buffer, sizeof buffer, in)) {
if (partno == nparts)
break;
if (!fgets (buffer, sizeof buffer, in)) {
if (partno == nparts)
break;
- adios (NULL, "premature eof");
}
if ((pos += (len = strlen (buffer))) > CPERMSG) {
}
if ((pos += (len = strlen (buffer))) > CPERMSG) {
if (strcmp(*vp, "xoauth2") == 0) {
#ifdef OAUTH_SUPPORT
if (setup_oauth_params(vec, vecp, auth_svc, &message) != OK) {
if (strcmp(*vp, "xoauth2") == 0) {
#ifdef OAUTH_SUPPORT
if (setup_oauth_params(vec, vecp, auth_svc, &message) != OK) {
- adios(NULL, "%s", message);
}
break;
#else
NMH_UNUSED(auth_svc);
}
break;
#else
NMH_UNUSED(auth_svc);
- adios(NULL, "send built without OAUTH_SUPPORT, "
+ die("send built without OAUTH_SUPPORT, "
"so -saslmech xoauth2 is not supported");
#endif /* OAUTH_SUPPORT */
}
"so -saslmech xoauth2 is not supported");
#endif /* OAUTH_SUPPORT */
}
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
if (! mh_oauth_get_service_info(auth_svc, &svc, errbuf,
sizeof(errbuf)))
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
if (! mh_oauth_get_service_info(auth_svc, &svc, errbuf,
sizeof(errbuf)))
- adios(NULL, "Unable to retrieve oauth profile entries: %s",
+ die("Unable to retrieve oauth profile entries: %s",
errbuf);
vec[(*vecp)++] = mh_xstrdup("-authservice");
errbuf);
vec[(*vecp)++] = mh_xstrdup("-authservice");
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
draftsw++;
if (mode == SHOW)
continue;
usage:
draftsw++;
if (mode == SHOW)
continue;
usage:
- adios (NULL,
- "usage: %s [+folder] [switches] [switches for showproc]",
+ die( "usage: %s [+folder] [switches] [switches for showproc]",
invo_name);
case FILESW:
if (mode != SHOW)
goto usage;
if (draftsw || file)
invo_name);
case FILESW:
if (mode != SHOW)
goto usage;
if (draftsw || file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FORMSW:
app_msgarg(&vec, --cp);
if (!(cp = *argp++) || *cp == '-')
file = path (cp, TFILE);
continue;
case FORMSW:
app_msgarg(&vec, --cp);
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
app_msgarg(&vec, mh_xstrdup(etcpath(cp)));
continue;
app_msgarg(&vec, mh_xstrdup(etcpath(cp)));
continue;
case WCACHESW:
app_msgarg(&vec, --cp);
if (!(cp = *argp++) || *cp == '-')
case WCACHESW:
app_msgarg(&vec, --cp);
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
app_msgarg(&vec, cp);
continue;
case SHOWSW:
if (!(showproc = *argp++) || *showproc == '-')
app_msgarg(&vec, cp);
continue;
case SHOWSW:
if (!(showproc = *argp++) || *showproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nshow = 0;
continue;
case NSHOWSW:
nshow = 0;
continue;
case NSHOWSW:
case SHOWMIMESW:
if (!(showmimeproc = *argp++) || *showmimeproc == '-')
case SHOWMIMESW:
if (!(showmimeproc = *argp++) || *showmimeproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nshow = 0;
continue;
case CHECKMIMESW:
nshow = 0;
continue;
case CHECKMIMESW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (mode != SHOW)
folder = pluspath (cp);
} else {
if (mode != SHOW)
if (draftsw || file) {
if (msgs.size)
if (draftsw || file) {
if (msgs.size)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (draftsw)
app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf)));
else
if (draftsw)
app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf)));
else
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case ADDRSW:
if (!(addr = *argp++))/* allow -xyz arguments */
case ADDRSW:
if (!(addr = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case INFOSW:
if (!(info = *argp++))/* allow -xyz arguments */
continue;
case INFOSW:
if (!(info = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(user = *argp++))/* allow -xyz arguments */
continue;
case USERSW:
if (!(user = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case FILESW:
if (!(file = *argp++) || *file == '-')
continue;
case FILESW:
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SENDERSW:
if (!(sender = *argp++))/* allow -xyz arguments */
continue;
case SENDERSW:
if (!(sender = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MAILBOXSW:
if (!(mbox = *argp++) || *mbox == '-')
continue;
case MAILBOXSW:
if (!(mbox = *argp++) || *mbox == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case HOMESW:
if (!(home = *argp++) || *home == '-')
continue;
case HOMESW:
if (!(home = *argp++) || *home == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MAILSW:
if (!(cp = *argp++) || *cp == '-')
continue;
case MAILSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "only one maildelivery file at a time!");
+ die("only one maildelivery file at a time!");
- adios (NULL, "only switch arguments are supported");
+ die("only switch arguments are supported");
user = getusername ();
}
if ((pw = getpwnam (user)) == NULL)
user = getusername ();
}
if ((pw = getpwnam (user)) == NULL)
- adios (NULL, "no such local user as %s", user);
+ die("no such local user as %s", user);
if (chdir (pw->pw_dir) == -1)
if (chdir ("/") < 0) {
if (chdir (pw->pw_dir) == -1)
if (chdir ("/") < 0) {
/* Record the delivery time */
if ((now = dlocaltimenow ()) == NULL)
/* Record the delivery time */
if ((now = dlocaltimenow ()) == NULL)
- adios (NULL, "unable to ascertain local time");
+ die("unable to ascertain local time");
snprintf (ddate, sizeof(ddate), "Delivery-Date: %s\n", dtimenow (0));
/*
snprintf (ddate, sizeof(ddate), "Delivery-Date: %s\n", dtimenow (0));
/*
if (debug)
debug_printf ("retrieving message from file \"%s\"\n", file);
if ((fd = copy_message (tempfd, tmpfil, 1)) == -1)
if (debug)
debug_printf ("retrieving message from file \"%s\"\n", file);
if ((fd = copy_message (tempfd, tmpfil, 1)) == -1)
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
close (tempfd);
} else {
get_temp_dir());
close (tempfd);
} else {
if (debug)
debug_printf ("retrieving message from stdin\n");
if ((fd = copy_message (fileno (stdin), tmpfil, 1)) == -1)
if (debug)
debug_printf ("retrieving message from stdin\n");
if ((fd = copy_message (fileno (stdin), tmpfil, 1)) == -1)
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
(void) m_unlink (tmpfil);
if (!(fp = fdopen (fd, "r+")))
(void) m_unlink (tmpfil);
if (!(fp = fdopen (fd, "r+")))
- adios (NULL, "unable to access temporary file");
+ die("unable to access temporary file");
/*
* If no sender given, extract it
/*
* If no sender given, extract it
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
- adios (NULL, "only one date field at a time");
+ die("only one date field at a time");
if (!(datesw = *argp++) || *datesw == '-')
if (!(datesw = *argp++) || *datesw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case TEXTSW:
if (subjsort)
continue;
case TEXTSW:
if (subjsort)
- adios (NULL, "only one text field at a time");
+ die("only one text field at a time");
if (!(subjsort = *argp++) || *subjsort == '-')
if (!(subjsort = *argp++) || *subjsort == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
case LIMSW:
if (!(cp = *argp++) || *cp == '-')
case LIMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
while (*cp == '0')
cp++; /* skip any leading zeros */
if (!*cp) { /* hit end of string */
while (*cp == '0')
cp++; /* skip any leading zeros */
if (!*cp) { /* hit end of string */
continue;
}
if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
continue;
}
if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
- adios (NULL, "impossible limit %s", cp);
+ die("impossible limit %s", cp);
datelimit *= 60*60*24;
continue;
case NLIMSW:
datelimit *= 60*60*24;
continue;
case NLIMSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
if (allmsgs) {
app_msgarg(&msgs, "all");
} else {
if (allmsgs) {
app_msgarg(&msgs, "all");
} else {
- adios (NULL, "must specify messages to sort with -noall");
+ die("must specify messages to sort with -noall");
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
seq_setprev (mp); /* set the previous sequence */
if ((nmsgs = read_hdrs (mp, datesw)) <= 0)
seq_setprev (mp); /* set the previous sequence */
if ((nmsgs = read_hdrs (mp, datesw)) <= 0)
- adios (NULL, "no messages to sort");
+ die("no messages to sort");
if (checksw && check_failed) {
if (checksw && check_failed) {
- adios (NULL, "errors found, no messages sorted");
+ die("errors found, no messages sorted");
- adios (NULL, "internal error -- you lose");
+ die("internal error -- you lose");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case TOSW:
if (!(f1 = *argp++))
case TOSW:
if (!(f1 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SUBJECTSW:
if (!(f2 = *argp++))
continue;
case SUBJECTSW:
if (!(f2 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PARAMSW:
if (!(f3 = *argp++))
continue;
case PARAMSW:
if (!(f3 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case DESCRIPTSW:
if (!(f4 = *argp++))
continue;
case DESCRIPTSW:
if (!(f4 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case COMMENTSW:
if (!(f5 = *argp++))
continue;
case COMMENTSW:
if (!(f5 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case DELAYSW:
if (!(cp = *argp++) || *cp == '-')
continue;
case DELAYSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
/*
* If there is an error, just reset the delay parameter
/*
* If there is an error, just reset the delay parameter
continue;
case FROMSW:
if (!(f7 = *argp++))
continue;
case FROMSW:
if (!(f7 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "missing -viamail \"mailpath\" switch");
+ die("missing -viamail \"mailpath\" switch");
via_mail (f1, f2, f3, f4, f5, delay, f7);
return 0; /* dead code to satisfy the compiler */
via_mail (f1, f2, f3, f4, f5, delay, f7);
return 0; /* dead code to satisfy the compiler */
umask (~m_gmprot ());
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
umask (~m_gmprot ());
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (tmpfil, tfile, sizeof(tmpfil));
}
strncpy (tmpfil, tfile, sizeof(tmpfil));
ambigsw (cp, whatnowswitches);
done (1);
case UNKWNSW:
ambigsw (cp, whatnowswitches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
case DFOLDSW:
if (dfolder)
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
continue;
case NDFLDSW:
dfolder = NULL;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
nedit = 0;
continue;
case NEDITSW:
case PRMPTSW:
if (!(myprompt = *argp++) || *myprompt == '-')
case PRMPTSW:
if (!(myprompt = *argp++) || *myprompt == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
- adios (NULL, "only one draft at a time!");
+ die("only one draft at a time!");
*/
int trailln = strlen(trailcmd) + 4;
if (ln < 0 || ln + trailln > bufsz)
*/
int trailln = strlen(trailcmd) + 4;
if (ln < 0 || ln + trailln > bufsz)
- adios(NULL, "arguments too long");
+ die("arguments too long");
ln = strlen(*argp);
/* +1 for leading space */
if (ln + trailln + 1 > bufsz - (cp-buf))
ln = strlen(*argp);
/* +1 for leading space */
if (ln + trailln + 1 > bufsz - (cp-buf))
- adios(NULL, "arguments too long");
+ die("arguments too long");
*cp++ = ' ';
memcpy(cp, *argp, ln+1);
cp += ln;
*cp++ = ' ';
memcpy(cp, *argp, ln+1);
cp += ln;
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
#else
NMH_UNUSED (user);
NMH_UNUSED (auth_svc);
#else
NMH_UNUSED (user);
NMH_UNUSED (auth_svc);
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
#ifdef OAUTH_SUPPORT
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
#ifdef OAUTH_SUPPORT
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
case DFOLDSW:
if (dfolder)
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
continue;
case NDFLDSW:
dfolder = NULL;
case MTSSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
case MTSSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
}
}
if (msg)
vec[vecp++] = cp;
continue;
}
}
if (msg)
- adios (NULL, "only one draft at a time!");
+ die("only one draft at a time!");
vec[vecp++] = msg = cp;
}
vec[vecp++] = msg = cp;
}