Removed mhn, as it was already replaced by mhlist/mhshow/mhstore.
[mmh] / sbr / getfolder.c
1
2 /*
3  * getfolder.c -- get the current or default folder
4  *
5  * This code is Copyright (c) 2002, by the authors of nmh.  See the
6  * COPYRIGHT file in the root directory of the nmh distribution for
7  * complete copyright information.
8  */
9
10 #include <h/mh.h>
11
12
13 char *
14 getfolder(int wantcurrent)
15 {
16     register char *folder;
17
18     /*
19      * If wantcurrent == 1, then try the current folder first
20      */
21     if (wantcurrent && (folder = context_find (pfolder)) && *folder != '\0')
22         return folder;
23
24     /*
25      * Else try the Inbox profile entry
26      */
27     if ((folder = context_find (inbox)) && *folder != '\0')
28         return folder;
29
30     /*
31      * Else return compile time default.
32      */
33     return defaultfolder;
34 }