2 Proprietary Rand Corporation
, 1981.
3 Further distribution of
this software
4 subject to the terms of the Rand
10 #include <sys/types.h>
13 extern struct swit anoyes
[]; /* Std no/yes gans array */
18 extern char _sobuf
[]; /* MLW standard out buffer */
23 register char *cp
, *path
;
24 register struct node
*np
;
30 setbuf(stdout
, _sobuf
);
31 autof
= (argc
== 2 && strcmp(argv
[1], "-auto") == 0);
32 exitstat
= 1; /* Assume errors will occur */
33 mypath
= getenv("HOME");
34 /*** mypath = getpath(getruid()); /* to prevent recursion via m_getdefs */
35 VOID
copy(mh_prof
, copy(mypath
, defpath
));
36 if(stat(defpath
, &stbuf
) != -1) {
38 printf("Install-defs invocation error!\n");
40 printf("You already have an MH profile... use an editor \
45 if(autof
|| gans("Do you want help? ", anoyes
)) {
46 printf("\nPrior to using MH, it is necessary to have a file in your login\n");
47 printf("directory (%s) named %s which contains information\n",mypath
,mh_prof
+1);
48 printf("to direct certain MH operations. The only item which is required\n");
49 printf("is the path to use for all MH folder operations. The suggested MH\n");
50 printf("path for you is %s/Mail...\n\n", mypath
);
52 cp
= concat(mypath
, "/", "Mail", NULLCP
);
53 if(stat(cp
, &stbuf
) != -1) {
54 if((stbuf
.st_mode
&S_IFMT
) == S_IFDIR
) {
55 cp
= concat("You already have the standard MH directory \"",
56 cp
, "\".\nDo you want to use it for MH? ", NULLCP
);
63 cp
= concat("Do you want the standard MH path \"", mypath
,
64 "/", "Mail\"? ", NULLCP
);
68 xyz
: if(gans("Do you want a path below your login directory? ",
70 printf("What is the path ?? %s/", mypath
);
73 printf("What is the whole path?? /");
74 path
= concat("/", geta(), NULLCP
);
79 if(chdir(path
) == -1) {
80 cp
= concat("\"", path
, "\" doesn't exist; Create it? ", NULLCP
);
82 if(makedir(path
) == 0) {
83 printf("Can't create it!\n");
87 printf("[Using existing directory]\n");
89 np
= m_defs
= (struct node
*) malloc(sizeof *np
);
93 m_replace(pfolder
, defalt
);
104 static char line
[128];
110 while((c
= getchar()) != EOF
) {