From 420be2bf035157b1c4f4c7d23db0f1b69e448c0d Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 4 Jun 2015 11:21:15 +0000 Subject: [PATCH] - Re-built lexer file git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@6047 82007160-df01-0410-b94d-b575c5fd34c7 --- src/config-lexer.c | 50 ++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/config-lexer.c b/src/config-lexer.c index 4e49946..7e55611 100644 --- a/src/config-lexer.c +++ b/src/config-lexer.c @@ -779,9 +779,9 @@ char *yytext; #include "config-parser.h" -void ccomment(void); +static void ccomment(void); -int linenum = 1; +unsigned int linenum = 1; char linebuf[512]; #line 788 "config-lexer.c" @@ -2567,34 +2567,40 @@ void yyfree (void * ptr ) /* C-comment ignoring routine -kre*/ -void ccomment(void) +static void +ccomment(void) { - int c; + int c = 0; /* log(L_NOTICE, "got comment"); */ while (1) { - while ((c = input()) != '*' && c != EOF) - if (c == '\n') ++linenum; - if (c == '*') - { - while ((c = input()) == '*'); - if (c == '/') break; - else if (c == '\n') - ++linenum; - } + while ((c = input()) != '*' && c != EOF) + if (c == '\n') + ++linenum; + + if (c == '*') + { + while ((c = input()) == '*') + /* Nothing */ ; + if (c == '/') + break; + else if (c == '\n') + ++linenum; + } + if (c == EOF) { - YY_FATAL_ERROR("EOF in comment"); - /* XXX hack alert this disables - * the stupid unused function warning - * gcc generates - */ - if(1 == 0) - yy_fatal_error("EOF in comment"); - break; + YY_FATAL_ERROR("EOF in comment"); + + /* XXX hack alert this disables + * the stupid unused function warning + * gcc generates + */ + if (1 == 0) + yy_fatal_error("EOF in comment"); + break; } } } - -- 2.30.2