Commit | Line | Data |
---|---|---|
6120f4b4 C |
1 | /************************************************************************* |
2 | * This program is copyright (C) 1985, 1986 by Jonathan Payne. It is * | |
3 | * provided to you without charge for use only on a licensed Unix * | |
4 | * system. You may copy JOVE provided that this notice is included with * | |
5 | * the copy. You may not sell copies of this program or versions * | |
6 | * modified for use on microcomputer systems, unless the copies are * | |
7 | * included with a Unix system distribution and the source is provided. * | |
8 | *************************************************************************/ | |
9 | ||
10 | #include <sys/types.h> | |
11 | #include <sys/file.h> | |
12 | ||
13 | #ifndef TEACHJOVE | |
14 | # define TEACHJOVE "/usr/lib/jove/teach-jove" | |
15 | #endif | |
16 | ||
17 | #ifndef W_OK | |
18 | # define W_OK 2 | |
19 | #endif | |
20 | ||
21 | extern char *getenv(); | |
22 | ||
23 | main() | |
24 | { | |
25 | char cmd[256], | |
26 | fname[256], | |
27 | *home; | |
28 | ||
29 | if ((home = getenv("HOME")) == 0) { | |
30 | printf("teachjove: cannot find your home!\n"); | |
31 | exit(-1); | |
32 | } | |
33 | (void) sprintf(fname, "%s/teach-jove", home); | |
34 | if (access(fname, F_OK) != 0) { | |
35 | (void) sprintf(cmd, "cp %s %s", TEACHJOVE, fname); | |
36 | system(cmd); | |
37 | } | |
38 | (void) execlp("jove", "teachjove", fname, (char *) 0); | |
39 | printf("teachjove: cannot execl jove!\n"); | |
40 | } | |
41 |