blob: 542b38b3813b561097bca8739e086f426950d14e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
$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 <X11/Xresource.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
+#include <stdlib.h>
#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:
|