Completely reworked the path convertion functions
[mmh] / uip / scan.c
index 80addfc..1276d5b 100644 (file)
@@ -143,8 +143,8 @@ main(int argc, char **argv)
                                case FILESW:
                                        if (!(cp = *argp++) || (cp[0] == '-' && cp[1]))
                                                adios(NULL, "missing argument to %s", argp[-2]);
-                                       if (strcmp(file = cp, "-"))
-                                               file = path(cp, TFILE);
+                                       if (strcmp(file = cp, "-")!=0)
+                                               file = getcpy(expanddir(cp));
                                        continue;
                        }
                }
@@ -152,9 +152,9 @@ main(int argc, char **argv)
                        if (folder)
                                adios(NULL, "only one folder at a time!");
                        else
-                               folder = pluspath(cp);
+                               folder = getcpy(expandfol(cp));
                } else
-                               app_msgarg(&msgs, cp);
+                       app_msgarg(&msgs, cp);
        }
 
        /*
@@ -175,9 +175,8 @@ main(int argc, char **argv)
                if (strcmp(file, "-") == 0) {
                        in = stdin;
                        file = "stdin";
-               } else {
-                       if ((in = fopen(file, "r")) == NULL)
-                               adios(file, "unable to open");
+               } else if (!(in = fopen(file, "r"))) {
+                       adios(file, "unable to open");
                }
 
 #ifndef JLR
@@ -204,8 +203,8 @@ main(int argc, char **argv)
        if (!msgs.size)
                app_msgarg(&msgs, "all");
        if (!folder)
-               folder = getfolder(FCUR);
-       maildir = m_maildir(folder);
+               folder = getcurfol();
+       maildir = toabsdir(folder);
 
        if (chdir(maildir) == NOTOK)
                adios(maildir, "unable to change directory to");