diff options
author | rsc <devnull@localhost> | 2004-08-16 17:20:41 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-08-16 17:20:41 +0000 |
commit | d16cfe2431bc5e31128adf0d577a3483a89f8f82 (patch) | |
tree | 1ce0413e8c299eda0b4b6174b86301b609daa2b8 /src/cmd/grap | |
parent | bdf49b7ee0229aa7c871402aed264789c901ff69 (diff) | |
download | plan9port-d16cfe2431bc5e31128adf0d577a3483a89f8f82.tar.gz plan9port-d16cfe2431bc5e31128adf0d577a3483a89f8f82.tar.bz2 plan9port-d16cfe2431bc5e31128adf0d577a3483a89f8f82.zip |
handle grap.defines properly
Diffstat (limited to 'src/cmd/grap')
-rw-r--r-- | src/cmd/grap/main.c | 2 | ||||
-rw-r--r-- | src/cmd/grap/print.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/grap/main.c b/src/cmd/grap/main.c index ea0309d4..07f4ecad 100644 --- a/src/cmd/grap/main.c +++ b/src/cmd/grap/main.c @@ -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; diff --git a/src/cmd/grap/print.c b/src/cmd/grap/print.c index 1636ec21..4598cb81 100644 --- a/src/cmd/grap/print.c +++ b/src/cmd/grap/print.c @@ -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 { |