- switch (*name) {
- case '+':
- return path(name+1, TFOLDER);
- case '@':
- return path(name+1, TSUBCWF);
- default:
- return path(name, TFILE);
+ static char buf[BUFSIZ];
+
+ if (*path == '/') {
+ /* nothing to do */
+ strncpy(buf, path, sizeof buf);
+ packpath(buf);
+ return buf;
+
+ } else if (*path == '.') {
+ /* rel dir path */
+ strncpy(buf, expanddir(path), sizeof buf);
+ return buf;
+
+ } else {
+ /* folder path */
+ char *cp=buf, *pp;
+
+ if (!(pp = context_find("path")) || !*pp) {
+ adios(NULL, "Non-empty profile entry `Path' required");
+ }
+ if (*pp != '/') {
+ /* Path is relative to $HOME */
+ snprintf(buf, sizeof buf, "%s/", mypath);
+ cp += strlen(buf);
+ }
+ strcpy(cp, pp);
+ packpath(buf);
+ /* append the mail folder */
+ cp = buf + strlen(buf);
+ *cp++ = '/';
+ strcpy(cp, expandfol(path));
+ return buf;