- cp = draftfolder;
- folder = path(*cp == '+' || *cp == '@' ? cp + 1 : cp,
- *cp != '@' ? TFOLDER : TSUBCWF);
-
- chdir(m_maildir(""));
- strncpy(buffer, m_maildir(folder), sizeof(buffer));
-
- create_folder(buffer, 0, done);
-
- if (chdir(buffer) == -1)
- adios(buffer, "unable to change directory to");
-
- if (!(mp = folder_read(folder)))
- adios(NULL, "unable to read folder %s", folder);
+ folder = mh_xstrdup(toabsdir(draftfolder));
+ create_folder(folder, 0, exit);
+ if (!(mp = folder_read(folder))) {
+ adios(EX_IOERR, NULL, "unable to read folder %s", folder);
+ }
+ mh_free0(&folder);