mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
handle grap.defines properly
This commit is contained in:
parent
bdf49b7ee0
commit
d16cfe2431
2 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue