lex would suicide under some strange circumstances (not my lex code) Turned out to be multiple Bterm()s of stdin. -Steve Reference: /n/sources/patch/applied/lex Date: Mon Oct 18 19:38:41 CES 2004 --- /sys/src/cmd/lex/sub1.c Mon Oct 18 19:38:43 2004 +++ /sys/src/cmd/lex/sub1.c Mon Oct 18 19:38:41 2004 @@ -287,6 +287,7 @@ if(c == Beof) { eof = TRUE; Bterm(fin); + fin = 0; return(0); } if(c == '\n')yyline++; --- /sys/src/cmd/lex/lmain.c Mon Oct 18 19:38:41 2004 +++ /sys/src/cmd/lex/lmain.c Mon Oct 18 19:38:40 2004 @@ -38,7 +38,7 @@ int funcflag; int pflag; int chset; /* 1 = char set modified */ -Biobuf *fin, *fother; +Biobuf *fin = 0, *fother; int fptr; int *name; int *left; @@ -186,7 +186,8 @@ debug || # endif report == 1)statistics(); - Bterm(fin); + if (fin) + Bterm(fin); exits(0); /* success return code */ }