X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/880ff2a4f8f33fede426b21858dda31b58ffd27a..9322ba2854211794c27fae9468768b80b767c211:/uip/install-mh.c diff --git a/uip/install-mh.c b/uip/install-mh.c index b3271159..09d1f9df 100644 --- a/uip/install-mh.c +++ b/uip/install-mh.c @@ -80,8 +80,8 @@ main (int argc, char **argv) * the home directory field in the password file if that's not found. */ - if ((mypath = getenv("HOME")) == (char *)0) { - if ((pw = getpwuid(getuid())) == (struct passwd *)0 || *pw->pw_dir == '\0') + if ((mypath = getenv("HOME")) == NULL) { + if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0') adios(NULL, "cannot determine your home directory"); else mypath = pw->pw_dir; @@ -143,7 +143,7 @@ main (int argc, char **argv) } } else { if (autof) - printf ("I'm going to create the standard nmh path for you.\n"); + puts("I'm going to create the standard nmh path for you."); else cp = concat ("Do you want the standard nmh path \"", mypath, "/", "Mail\"? ", NULL); @@ -174,16 +174,16 @@ query: if (makedir (pathname) == 0) adios (NULL, "unable to create %s", pathname); } else { - printf ("[Using existing directory]\n"); + puts("[Using existing directory]"); } /* * Add some initial elements to the profile/context list */ - m_defs = (struct node *) mh_xmalloc (sizeof *np); - np = m_defs; - np->n_name = getcpy ("Path"); - np->n_field = getcpy (pathname); + NEW(np); + m_defs = np; + np->n_name = mh_xstrdup("Path"); + np->n_field = mh_xstrdup(pathname); np->n_context = 0; np->n_next = NULL; @@ -223,6 +223,10 @@ query: puts ("\nPlease see the nmh(7) man page for an introduction to nmh.\n"); print_intro (stdout, FALSE); + /* Initialize the saved nmh version. The Path profile entry was added + above, that's all this needs. */ + (void) nmh_version_changed (0); + done (0); return 1; }