Move chdir() call so -recurse option works again
authorEric Schnoebelen <eric@cirr.com>
Fri, 31 Aug 2012 13:49:37 +0000 (09:49 -0400)
committermarkus schnalke <meillo@marmaro.de>
Fri, 23 Oct 2015 08:16:15 +0000 (10:16 +0200)
This commit is ported from nmh.

uip/folder.c

index 3ca0e7d..4ffb9f5 100644 (file)
@@ -329,16 +329,17 @@ main(int argc, char **argv)
        /*
        ** Scan the folders
        */
+       /*
+       ** change directory to base of nmh directory for
+       ** crawl_folders
+       */
+       if (chdir(nmhdir) == NOTOK) {
+               adios(EX_OSERR, nmhdir, "unable to change directory to");
+       }
        if (all || ftotal > 0) {
                /*
                ** If no folder is given, do them all
                */
-               /*
-               ** change directory to base of nmh directory for
-               ** crawl_folders
-               */
-               if (chdir(nmhdir) == NOTOK)
-                       adios(EX_OSERR, nmhdir, "unable to change directory to");
                if (!argfolder) {
                        if (msg)
                                admonish(NULL, "no folder given for message %s", msg);