]>
diplodocus.org Git - nmh/blob - sbr/getarguments.c
3 * getarguments.c -- Get the argument vector ready to go.
7 * This code is Copyright (c) 2002, by the authors of nmh. See the
8 * COPYRIGHT file in the root directory of the nmh distribution for
9 * complete copyright information.
15 getarguments (char *invo_name
, int argc
, char **argv
, int check_context
)
17 char *cp
, **ap
, **bp
, **arguments
;
21 * Check if profile/context specifies any arguments
23 if (check_context
&& (cp
= context_find (invo_name
))) {
24 cp
= getcpy (cp
); /* make copy */
25 ap
= brkstring (cp
, " ", "\n"); /* split string */
27 /* Count number of arguments split */
33 if (!(arguments
= (char **) malloc ((argc
+ n
) * sizeof(*arguments
))))
34 adios (NULL
, "unable to malloc argument storage");
37 /* Copy any arguments from profile/context */
43 /* Copy arguments from command line */
48 /* Now NULL terminate the array */