2 ** getarguments.c -- Get the argument vector ready to go.
4 ** This code is Copyright (c) 2002, by the authors of nmh. See the
5 ** COPYRIGHT file in the root directory of the nmh distribution for
6 ** complete copyright information.
13 getarguments(char *invo_name, int argc, char **argv, int check_context)
15 char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL;
19 ** Check if profile/context specifies any arguments
21 if (check_context && (cp = context_find(invo_name))) {
22 cp = mh_xstrdup(cp); /* make copy */
23 ap = brkstring(cp, " ", "\n"); /* split string */
25 /* Count number of arguments split */
31 arguments = mh_xcalloc(argc + n, sizeof(*arguments));
34 /* Copy any arguments from profile/context */
35 if (ap != NULL && n > 0) {
40 /* Copy arguments from command line */
45 /* Now NULL terminate the array */