1: /* refile.c - refile the draft into another folder */
   2: 
   3: 
   4: #include "../h/mh.h"
   5: #include <stdio.h>
   6: 
   7: int     refile (arg, file)
   8: register char **arg,
   9:                *file;
  10: {
  11:     int     pid;
  12:     register int    vecp;
  13:     char   *vec[MAXARGS];
  14: 
  15:     vecp = 0;
  16:     vec[vecp++] = r1bindex (fileproc, '/');
  17:     vec[vecp++] = "-file";
  18:     vec[vecp++] = file;
  19: 
  20:     if (arg)
  21:     while (*arg)
  22:         vec[vecp++] = *arg++;
  23:     vec[vecp] = NULL;
  24: 
  25:     m_update ();
  26:     (void) fflush (stdout);
  27: 
  28:     switch (pid = vfork ()) {
  29:     case NOTOK:
  30:         advise ("fork", "unable to");
  31:         return NOTOK;
  32: 
  33:     case OK:
  34:         execvp (fileproc, vec);
  35:         fprintf (stderr, "unable to exec ");
  36:         perror (fileproc);
  37:         _exit (-1);
  38: 
  39:     default:
  40:         return (pidwait (pid, NOTOK));
  41:     }
  42: }

Defined functions

refile defined in line 7; never used
Last modified: 1985-10-27
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 947
Valid CSS Valid XHTML 1.0 Strict