*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* option is specified, only the last path name component of each field
* body is output. The entire field body is output if the -text option
* is used; the contents of the -text argument are ignored. If the -list
* option is specified, only the last path name component of each field
* body is output. The entire field body is output if the -text option
* is used; the contents of the -text argument are ignored. If the -list
* below, each line is numbered starting with 1. A tab separates the
* number from the field body.
*
* below, each line is numbered starting with 1. A tab separates the
* number from the field body.
*
- unsigned char *comp = NULL;
- char *text = NULL, *folder = NULL, buf[BUFSIZ];
+ char *comp = NULL, *text = NULL, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
char **argp, **arguments;
struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
-#ifdef LOCALE
- setlocale(LC_ALL, "");
-#endif
- invo_name = r1bindex (argv[0], '/');
-
- /* read user profile/context */
- context_read();
+ if (nmh_init(argv[0], true, true)) { return 1; }
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
- adios (NULL, "only one folder at a time!");
- else
- folder = pluspath (cp);
+ die("only one folder at a time!");
+ folder = pluspath (cp);
- draft = getcpy(m_draft(folder, (char *)0, 1, &isdf));
+ draft = mh_xstrdup(m_draft(folder, NULL, 1, &isdf));
adios (maildir, "unable to change directory to");
/* read folder and create message structure */
adios (maildir, "unable to change directory to");
/* read folder and create message structure */
- if (!(mp = folder_read (folder)))
- adios (NULL, "unable to read folder %s", folder);
+ if (!(mp = folder_read (folder, 1)))
+ die("unable to read folder %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 (!isalnum (*cp) && *cp != '-')
- adios (NULL, "invalid component name %s", *ap);
+ if (!isalnum ((unsigned char) *cp) && *cp != '-')
+ die("invalid component name %s", *ap);