}
if (tarP) {
- ct->c_showproc = add(zP ? "%euncompress | tar tvf -" : (gzP ? "%egzip -dc | tar tvf -" : "%etar tvf -"), NULL);
+ ct->c_showproc = getcpy(zP ? "%euncompress | tar tvf -" : (gzP ? "%egzip -dc | tar tvf -" : "%etar tvf -"));
if (!ct->c_storeproc) {
if (autosw) {
- ct->c_storeproc = add(zP ? "| uncompress | tar xvpf -" : (gzP ? "| gzip -dc | tar xvpf -" : "| tar xvpf -"), NULL);
+ ct->c_storeproc = getcpy(zP ? "| uncompress | tar xvpf -" : (gzP ? "| gzip -dc | tar xvpf -" : "| tar xvpf -"));
ct->c_umask = 0022;
} else {
- ct->c_storeproc= add(zP ? "%m%P.tar.Z" : (gzP ? "%m%P.tar.gz" : "%m%P.tar"), NULL);
+ ct->c_storeproc= getcpy(zP ? "%m%P.tar.Z" : (gzP ? "%m%P.tar.gz" : "%m%P.tar"));
}
}
}
if ((cp = e->eb_name) && *cp != '/' && *cp != '.' &&
*cp != '|' && *cp != '!' && !strchr(cp, '%')) {
if (!ct->c_storeproc)
- ct->c_storeproc = add(cp, NULL);
+ ct->c_storeproc = getcpy(cp);
if (!p->c_storeproc)
- p->c_storeproc = add(cp, NULL);
+ p->c_storeproc = getcpy(cp);
}
}
*/
if (p) {
appending = 1;
- ct->c_storage = add(p->c_storage, NULL);
+ ct->c_storage = getcpy(p->c_storage);
/* record the folder name */
if (p->c_folder) {
- ct->c_folder = add(p->c_folder, NULL);
+ ct->c_folder = getcpy(p->c_folder);
}
goto got_filename;
}
/* Store content in temporary file for now */
tmpfilenam = m_mktemp(invo_name, NULL, NULL);
- ct->c_storage = add(tmpfilenam, NULL);
+ ct->c_storage = getcpy(tmpfilenam);
/* Get the folder name */
if (cp[1])
- folder = pluspath(cp);
+ folder = getcpy(expandfol(cp));
else
- folder = getfolder(1);
+ folder = getcurfol();
/* Check if folder exists */
- create_folder(m_mailpath(folder), 0, exit);
+ create_folder(toabsdir(folder), 0, exit);
/* Record the folder name */
- ct->c_folder = add(folder, NULL);
+ ct->c_folder = getcpy(folder);
if (cp[1])
free(folder);
return show_content_aux(ct, 1, 0, buffer + 1, dir);
/* record the filename */
- ct->c_storage = add(buffer, NULL);
+ ct->c_storage = getcpy(buffer);
got_filename:
/* flush the output stream */
/* Read the folder. */
if ((mp = folder_read(folder))) {
/* Link file into folder */
- msgnum = folder_addmsg(&mp, filename, 0, 0, 0, 0, (char *)0);
+ msgnum = folder_addmsg(&mp, filename, 0, 0, 0, 0, NULL);
} else {
advise(NULL, "unable to read folder %s", folder);
return NOTOK;
case 'm':
/* insert message number */
- snprintf(bp, buflen, "%s", r1bindex(ct->c_file, '/'));
+ snprintf(bp, buflen, "%s", mhbasename(ct->c_file));
break;
case 'P':
if (!mh_strcasecmp(*ap, "name") && *(cp = *ep) != '/' &&
*cp != '.' && *cp != '|' && *cp != '!' &&
!strchr(cp, '%')) {
- ct->c_storeproc = add(cp, NULL);
+ ct->c_storeproc = getcpy(cp);
return;
}
}