]>
diplodocus.org Git - nmh/blob - sbr/context_foil.c
3 * context_foil.c -- foil search of profile and context
11 * Foil search of users .mh_profile
12 * If error, return -1, else return 0
16 context_foil (char *path
)
18 register struct node
*np
;
20 defpath
= context
= "/dev/null";
23 * If path is given, create a minimal profile/context list
26 if (!(m_defs
= (struct node
*) malloc (sizeof(*np
)))) {
27 advise (NULL
, "unable to allocate profile storage");
32 if (!(np
->n_name
= strdup ("Path"))) {
33 advise (NULL
, "strdup failed");
36 if (!(np
->n_field
= strdup (path
))) {
37 advise (NULL
, "strdup failed");
43 if (mypath
== NULL
&& (mypath
= getenv ("HOME")) != NULL
)
44 if (!(mypath
= strdup (mypath
))) {
45 advise (NULL
, "strdup failed");