handle grap.defines properly

This commit is contained in:
rsc 2004-08-16 17:20:41 +00:00
parent bdf49b7ee0
commit d16cfe2431
2 changed files with 5 additions and 3 deletions

View file

@ -10,7 +10,7 @@
int dbg = 0;
#ifndef GRAPDEFINES
#define GRAPDEFINES "#9/sys/lib/grap.defines"
#define GRAPDEFINES "#9/lib/grap.defines"
#endif
char *lib_defines;

View file

@ -177,6 +177,7 @@ void do_first(void) /* done at first .G1: definitions, etc. */
{
extern int lib;
extern char *lib_defines;
char *file;
static char buf[50], buf1[50]; /* static because pbstr uses them */
FILE *fp;
extern int getpid(void);
@ -184,8 +185,9 @@ void do_first(void) /* done at first .G1: definitions, etc. */
sprintf(buf, "define pid /%d/\n", getpid());
pbstr(buf);
if (lib != 0) {
if ((fp = fopen(unsharp(lib_defines), "r")) != NULL) {
sprintf(buf1, "copy \"%s\"\n", lib_defines);
file = unsharp(lib_defines);
if ((fp = fopen(file, "r")) != NULL) {
sprintf(buf1, "copy \"%s\"\n", file);
pbstr(buf1);
fclose(fp);
} else {