commit - 75347226678394e8316d3e38ea64f44524e4f089
commit + 1e1cea296a776857a4c4a0180d3fa35a11e8c78e
blob - da761081831890aeef07a45f4f2bbf7a30079ef0
blob + bab62478c9ec29c9b9a54bbe5c3b7137e373eb52
--- src/cmd/grap/grap.h
+++ src/cmd/grap/grap.h
#define min(x,y) (((x) <= (y)) ? (x) : (y))
#define max(x,y) (((x) >= (y)) ? (x) : (y))
+extern char *unsharp(char*);
+
extern void yyerror(char *);
extern void coord_x(Point);
extern void coord_y(Point);
extern void plotnum(double, char *, Point);
extern void drawdesc(int, Obj *, Attr *, char *);
extern void next(Obj *, Point, Attr *);
+#define print grapprint
extern void print(void);
extern void endstat(void);
extern void graph(char *);
blob - 0c25bba1f049b5f704432d69418596cbec8ddacf
blob + c9c6c016332c8d583b0eb2523a23264c54249ebb
--- src/cmd/grap/input.c
+++ src/cmd/grap/input.c
FILE *fin;
if (newfile) {
- if ((fin = fopen(newfile, "r")) == NULL)
+ if ((fin = fopen(unsharp(newfile), "r")) == NULL)
ERROR "can't open file %s", newfile FATAL;
curfile++;
curfile->fin = fin;
blob - 417975626b7d94409bea7a8c21b5154c98e16a0a
blob + ea0309d463d36aab3efe2739b6d908245d30068b
--- src/cmd/grap/main.c
+++ src/cmd/grap/main.c
#include "grap.h"
#include "y.tab.h"
-extern char *unsharp(char*);
-
int dbg = 0;
+#ifndef GRAPDEFINES
+#define GRAPDEFINES "#9/sys/lib/grap.defines"
+#endif
char *lib_defines;
int lib = 1; /* 1 to include lib_defines */
{
extern void onintr(int), fpecatch(int);
- lib_defines = unsharp("#9/lib/grap.defines");
+ lib_defines = unsharp(GRAPDEFINES);
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
signal(SIGINT, onintr);
void onintr(int n)
{
- //n;
- if (!dbg)
+ if(n){}
+ if(!dbg)
unlink(tempfile);
exit(1);
}
blob - 9364d1104fe16cf60fe17894cea2e70fe7e5f3ae
blob + 1636ec21fbe749c23f2aabefe1fdb86f60e33bda
--- src/cmd/grap/print.c
+++ src/cmd/grap/print.c
sprintf(buf, "define pid /%d/\n", getpid());
pbstr(buf);
if (lib != 0) {
- if ((fp = fopen(lib_defines, "r")) != NULL) {
+ if ((fp = fopen(unsharp(lib_defines), "r")) != NULL) {
sprintf(buf1, "copy \"%s\"\n", lib_defines);
pbstr(buf1);
fclose(fp);