From: michael Date: Thu, 4 Jun 2015 11:21:43 +0000 (+0000) Subject: - Re-built lexer file X-Git-Tag: 1.0.7~7 X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=128dad540fb3e021b8c070e97521a3fbca887f5a;p=hopm.git - Re-built lexer file git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@6048 82007160-df01-0410-b94d-b575c5fd34c7 --- 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; } } } -