$NetBSD: patch-ag,v 1.2 2007/10/09 11:09:22 rillig Exp $ --- laylex.c.orig 1995-03-31 00:14:39.000000000 +0200 +++ laylex.c 2007-10-09 13:05:03.000000000 +0200 @@ -42,7 +42,7 @@ int LayYYleng; extern char LayYYtext[]; int LayYYmorfg; extern char *LayYYsptr, LayYYsbuf[]; int LayYYtchar; -FILE *LayYYin = {stdin}, *LayYYout = {stdout}; +FILE *LayYYin, *LayYYout; extern int LayYYlineno; struct LayYYsvf { struct LayYYwork *LayYYstoff; @@ -57,17 +57,30 @@ extern struct LayYYsvf LayYYsvec[], *Lay #include #include #include +#include #include "LayoutP.h" #include "laygram.h" static char *LayYYsourcebase, *LayYYsource; +static int count (char *s, char c); + #define input() (*LayYYsource++) #define unput(c) (--LayYYsource) # define YYNEWLINE 10 LayYYlex(){ int nstr; extern int LayYYprevious; +static initialised; + + if (!initialised) { + if (LayYYin == NULL) + LayYYin = stdin; + if (LayYYout == NULL) + LayYYout = stdout; + initialised = 1; + } + while((nstr = LayYYlook()) >= 0) LayYYfussy: switch(nstr){ case 0: