From: markus schnalke Date: Sat, 5 Nov 2011 17:13:17 +0000 (+0100) Subject: Refactored sbr/getfolder.c X-Git-Tag: mmh-thesis-end~475 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=32c2ca5c95ce1e43c158c28722097bcd2304eef2;p=mmh Refactored sbr/getfolder.c --- diff --git a/sbr/getfolder.c b/sbr/getfolder.c index 9a6b18b..fc87e1e 100644 --- a/sbr/getfolder.c +++ b/sbr/getfolder.c @@ -9,25 +9,26 @@ #include +/* +** Return the default (=inbox) or current folder. +** E.g. `getfolder(FDEF)' usually returns ``inbox''. +*/ char * getfolder(int wantcurrent) { - register char *folder; + char *folder; - /* - ** If wantcurrent == 1, then try the current folder first - */ - if (wantcurrent && (folder = context_find(pfolder)) && *folder != '\0') + if (wantcurrent && + (folder = context_find(pfolder)) && *folder != '\0') { + /* If wantcurrent, then try the current folder first */ return folder; - /* - ** Else try the Inbox profile entry - */ - if ((folder = context_find(inbox)) && *folder != '\0') + } else if ((folder = context_find(inbox)) && *folder != '\0') { + /* try the Inbox profile entry */ return folder; - /* - ** Else return compile time default. - */ - return defaultfolder; + } else { + /* return the compile time default */ + return defaultfolder; + } }