Added -nocontentid (and -contentid, for symmetry) switch to mhbuild. This allows...
[mmh] / sbr / getfolder.c
1
2 /*
3  * getfolder.c -- get the current or default folder
4  *
5  * $Id$
6  *
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.
10  */
11
12 #include <h/mh.h>
13
14
15 char *
16 getfolder(int wantcurrent)
17 {
18     register char *folder;
19
20     /*
21      * If wantcurrent == 1, then try the current folder first
22      */
23     if (wantcurrent && (folder = context_find (pfolder)) && *folder != '\0')
24         return folder;
25
26     /*
27      * Else try the Inbox profile entry
28      */
29     if ((folder = context_find (inbox)) && *folder != '\0')
30         return folder;
31
32     /*
33      * Else return compile time default.
34      */
35     return defaultfolder;
36 }