]> diplodocus.org Git - nmh/blobdiff - sbr/refile.c
read_switch_multiword.c: Move interface to own file.
[nmh] / sbr / refile.c
index 43ad908e1b61faa4d4a937ceeec3bca348a05d4f..b4442f18d9acdcf2074b74e9fb63e167dbc0822e 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * refile.c -- call the "fileproc" to refile the
+/* refile.c -- call the "fileproc" to refile the
  *          -- msg or draft into another folder
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
@@ -8,8 +6,13 @@
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "refile.h"
+#include "getcpy.h"
+#include "context_save.h"
+#include "arglist.h"
+#include "error.h"
+#include "h/utils.h"
 
 
 int
@@ -29,7 +32,7 @@ refile (char **arg, char *file)
 
     if (arg) {
        while (*arg)
-           vec[vecp++] = *arg++;
+           vec[vecp++] = mh_xstrdup(*arg++);
     }
     vec[vecp] = NULL;
 
@@ -45,10 +48,10 @@ refile (char **arg, char *file)
            execvp (program, vec);
            fprintf (stderr, "unable to exec ");
            perror (fileproc);
-           _exit (-1);
+           _exit(1);
 
        default: 
            arglist_free(program, vec);
-           return (pidwait (pid, -1));
+           return pidwait(pid, -1);
     }
 }