Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / sbr / RCS / refile.c,v
1 head    1.2;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.2
9 date    92.12.15.00.20.22;      author jromine; state Exp;
10 branches;
11 next    1.1;
12
13 1.1
14 date    92.02.10.17.03.18;      author jromine; state Exp;
15 branches;
16 next    ;
17
18
19 desc
20 @@
21
22
23 1.2
24 log
25 @endif sugar
26 @
27 text
28 @/* refile.c - refile the draft into another folder */
29 #ifndef lint
30 static char ident[] = "@@(#)$Id: refile.c,v 1.1 1992/02/10 17:03:18 jromine Exp jromine $";
31 #endif  /* lint */
32
33 #include "../h/mh.h"
34 #include <stdio.h>
35
36 int     refile (arg, file)
37 register char **arg,
38                *file;
39 {
40     int     pid;
41     register int    vecp;
42     char   *vec[MAXARGS];
43
44     vecp = 0;
45     vec[vecp++] = r1bindex (fileproc, '/');
46     vec[vecp++] = "-nolink";    /* override bad .mh_profile defaults */
47     vec[vecp++] = "-nopreserve";
48     vec[vecp++] = "-file";
49     vec[vecp++] = file;
50
51     if (arg)
52         while (*arg)
53             vec[vecp++] = *arg++;
54     vec[vecp] = NULL;
55
56     m_update ();
57     (void) fflush (stdout);
58
59     switch (pid = vfork ()) {
60         case NOTOK: 
61             advise ("fork", "unable to");
62             return NOTOK;
63
64         case OK: 
65             execvp (fileproc, vec);
66             fprintf (stderr, "unable to exec ");
67             perror (fileproc);
68             _exit (-1);
69
70         default: 
71             return (pidwait (pid, NOTOK));
72     }
73 }
74 @
75
76
77 1.1
78 log
79 @Initial revision
80 @
81 text
82 @d3 2
83 a4 2
84 static char ident[] = "@@(#)$Id: m_getdefs.c,v 1.4 1992/02/03 17:50:47 jromine Exp $";
85 #endif  lint
86 @