From 18ad1d01ab20aadded1a8d27f3bd1f2b76b1e628 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 5 Oct 2015 23:32:15 +0000 Subject: [PATCH] Remove EXTERN from lex.h and put the definitions in lex.c, from Michael McConville. --- bin/ksh/lex.c | 11 ++++++++++- bin/ksh/lex.h | 17 +++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c index ce833b7ff83..d6cfa5d5f51 100644 --- a/bin/ksh/lex.c +++ b/bin/ksh/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.56 2015/09/30 14:33:41 tedu Exp $ */ +/* $OpenBSD: lex.c,v 1.57 2015/10/05 23:32:15 nicm Exp $ */ /* * lexical analysis and source input @@ -70,6 +70,15 @@ int promptlen(const char *cp, const char **spp); static int backslash_skip; static int ignore_backslash_newline; +Source *source; /* yyparse/yylex source */ +YYSTYPE yylval; /* result from yylex */ +struct ioword *heres[HERES], **herep; +char ident[IDENT+1]; + +char **history; /* saved commands */ +char **histptr; /* last history item */ +int histsize; /* history size */ + /* optimized getsc_bn() */ #define getsc() (*source->str != '\0' && *source->str != '\\' \ && !backslash_skip ? *source->str++ : getsc_bn()) diff --git a/bin/ksh/lex.h b/bin/ksh/lex.h index 12d76769e46..114ea70bf8d 100644 --- a/bin/ksh/lex.h +++ b/bin/ksh/lex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.h,v 1.13 2013/03/03 19:11:34 guenther Exp $ */ +/* $OpenBSD: lex.h,v 1.14 2015/10/05 23:32:15 nicm Exp $ */ /* * Source input, lexer and parser @@ -118,15 +118,16 @@ typedef union { #define HERES 10 /* max << in line */ -EXTERN Source *source; /* yyparse/yylex source */ -EXTERN YYSTYPE yylval; /* result from yylex */ -EXTERN struct ioword *heres [HERES], **herep; -EXTERN char ident [IDENT+1]; +extern Source *source; /* yyparse/yylex source */ +extern YYSTYPE yylval; /* result from yylex */ +extern struct ioword *heres[HERES], **herep; +extern char ident[IDENT+1]; #ifdef HISTORY # define HISTORYSIZE 500 /* size of saved history */ -EXTERN char **history; /* saved commands */ -EXTERN char **histptr; /* last history item */ -EXTERN int histsize; /* history size */ +extern char **history; /* saved commands */ +extern char **histptr; /* last history item */ +extern int histsize; /* history size */ + #endif /* HISTORY */ -- 2.20.1