- }
-
- /*
- * Read the standard profile setup
- */
- if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) {
- readconfig ((struct node **) 0, fp, cp, 0);
- fclose (fp);
- }
-
- /* Check for public cache location */
- if ((cache_public = context_find (nmhcache)) && *cache_public != '/')
- cache_public = NULL;
-
- /* Check for private cache location */
- if (!(cache_private = context_find (nmhprivcache)))
- cache_private = ".cache";
- cache_private = getcpy (m_maildir (cache_private));
-
- /*
- * Check for storage directory. If defined, we
- * will store temporary files there. Else we
- * store them in standard nmh directory.
- */
- if ((cp = context_find (nmhstorage)) && *cp)
- tmp = concat (cp, "/", invo_name, NULL);
- else
- tmp = add (m_maildir (invo_name), NULL);
-
- if (!context_find ("path"))
- free (path ("./", TFOLDER));
-
- /* Check if we have a file to process */
- if (!compfile)
- adios (NULL, "need to specify a %s composition file", invo_name);
-
- /*
- * Process the composition file from standard input.
- */
- if (compfile[0] == '-' && compfile[1] == '\0') {
-
- /* copy standard input to temporary file */
- strncpy (infile, m_scratch ("", invo_name), sizeof(infile));
- if ((fp = fopen (infile, "w")) == NULL)
- adios (infile, "unable to open");
- while (fgets (buffer, BUFSIZ, stdin))
- fputs (buffer, fp);
- fclose (fp);
- unlink_infile = 1;