aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/yacc.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-12-04 17:45:49 +0000
committerrsc <devnull@localhost>2003-12-04 17:45:49 +0000
commitc5b9ff9fa8f7a65939c3592572a3df1b60dcf57e (patch)
treedce9424b222c536cd425040c81195eb48ee4cf71 /src/cmd/yacc.c
parentc72688efcfdebe28798396239e0fab6e9fc47584 (diff)
downloadplan9port-c5b9ff9fa8f7a65939c3592572a3df1b60dcf57e.tar.gz
plan9port-c5b9ff9fa8f7a65939c3592572a3df1b60dcf57e.tar.bz2
plan9port-c5b9ff9fa8f7a65939c3592572a3df1b60dcf57e.zip
add hoc
Diffstat (limited to 'src/cmd/yacc.c')
-rw-r--r--src/cmd/yacc.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/cmd/yacc.c b/src/cmd/yacc.c
index a9a2b2d7..05e9d589 100644
--- a/src/cmd/yacc.c
+++ b/src/cmd/yacc.c
@@ -13,8 +13,8 @@
#define SETBIT(a,i) ((a)[(i)>>5] |= (1<<((i)&037)))
#define NWORDS(n) (((n)+32)/32)
-#define PARSER "/sys/lib/yaccpar"
-#define PARSERS "/sys/lib/yaccpars"
+#define PARSER "lib/yaccpar"
+#define PARSERS "lib/yaccpars"
#define TEMPNAME "y.tmp.XXXXXX"
#define ACTNAME "y.acts.XXXXXX"
#define OFILE "tab.c"
@@ -398,10 +398,19 @@ void
others(void)
{
int c, i, j;
-
- finput = Bopen(parser, OREAD);
+ char *s, *root;
+
+ root = getenv("PLAN9");
+ if(root == nil)
+ root = "/usr/local/plan9";
+ s = malloc(strlen(root)+1+strlen(parser)+1);
+ strcpy(s, root);
+ strcat(s, "/");
+ strcat(s, parser);
+ finput = Bopen(s, OREAD);
if(finput == 0)
- error("cannot find parser %s", parser);
+ error("cannot find parser %s", s);
+ free(s);
warray("yyr1", levprd, nprod);
aryfil(temp1, nprod, 0);
PLOOP(1, i)