0
|
1 /* m_foil.c - foil search of .mh_profile */
|
|
2
|
|
3 #include "../h/mh.h"
|
|
4 #include <stdio.h>
|
|
5
|
|
6
|
|
7 void m_foil (path)
|
|
8 char *path;
|
|
9 {
|
|
10 register struct node *np;
|
|
11
|
|
12 defpath = context = "/dev/null";
|
|
13
|
|
14 if (path) {
|
|
15 np = m_defs = (struct node *) malloc (sizeof *np);
|
|
16 if (np == NULL)
|
|
17 adios (NULLCP, "unable to allocate profile storage");
|
|
18
|
|
19 np -> n_name = getcpy ("Path");
|
|
20 np -> n_field = getcpy (path);
|
|
21 np -> n_context = 0;
|
|
22 np -> n_next = NULL;
|
|
23
|
|
24 if (mypath == NULL && (mypath = getenv ("HOME")) != NULL)
|
|
25 mypath = strlen(mypath) < BUFSIZ / 4 ? getcpy (mypath) : NULL;
|
|
26 }
|
|
27 }
|