getcwd(path, sizeof(path));
RETURN(path);
};
+
+ /*
+ ** .pp
+ ** \fIThis is a read-only system property and, at runtime,
+ ** specifies the full path or URI of the folder currently
+ ** open (if any).\fP
+ */
+ const string_t folder_path(void) {
+ RETURN(CurrentFolder);
+ };
+
+ /*
+ ** .pp
+ ** \fIThis is a read-only system property and, at runtime,
+ ** specifies the actual name of the folder as far as it could
+ ** be detected.\fP
+ ** .pp
+ ** For detection, $$$folder is first taken into account
+ ** and simply stripped to form the result when a match is found. For
+ ** example, with $$$folder being \fTimap://host\fP and the folder is
+ ** \fTimap://host/INBOX/foo\fP, $$$madmutt_folder_name will be just
+ ** \fTINBOX/foo\fP.)
+ ** .pp
+ ** Second, if the initial portion of a name is not $$$folder,
+ ** the result will be everything after the last ``/''.
+ ** .pp
+ ** Third and last, the result will be just the name if neither
+ ** $$$folder nor a ``/'' were found in the name.
+ */
+ const string_t folder_name(void) {
+ const char *p;
+
+ if (!m_strisempty(Maildir)
+ && m_strstart(CurrentFolder, Maildir, &p) && *p) {
+ while (*p == '/')
+ p++;
+ RETURN(p);
+ } else {
+ p = strchr(CurrentFolder ?: "", '/');
+ RETURN(p ? p + 1 : (CurrentFolder ?: ""));
+ }
+ };
};
@package MTransport {