Completely reworked the path convertion functions
[mmh] / uip / mhstoresbr.c
index 0fa70ca..44fd19a 100644 (file)
@@ -249,13 +249,13 @@ store_application(CT ct)
                }
 
                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"));
                                }
                        }
                }
@@ -417,9 +417,9 @@ store_external(CT ct)
                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);
                }
        }
 
@@ -506,11 +506,11 @@ store_content(CT ct, CT p)
                */
                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;
                }
@@ -550,19 +550,19 @@ store_content(CT ct, CT p)
 
                /* 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(FCUR);
+                       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);
@@ -584,7 +584,7 @@ store_content(CT ct, CT p)
                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 */
@@ -1033,7 +1033,7 @@ get_storeproc(CT ct)
                if (!mh_strcasecmp(*ap, "name") && *(cp = *ep) != '/' &&
                                *cp != '.' && *cp != '|' && *cp != '!' &&
                                !strchr(cp, '%')) {
-                       ct->c_storeproc = add(cp, NULL);
+                       ct->c_storeproc = getcpy(cp);
                        return;
                }
        }