always trim the trailing ';'

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-05-01 00:27:27 +00:00
parent 33167fc41c
commit 01360f6440
2 changed files with 7 additions and 11 deletions

View File

@@ -378,9 +378,7 @@ includes { STORE_POS; return KW_INCLUDES;}
<semic>{NOSEMIC}; { <semic>{NOSEMIC}; {
STORE_LOC; STORE_LOC;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
/* XXX maybe the truncation should be unconditional ? */ yylval->str[yyleng-1] = '\0';
if(yyleng > 1)
*(yylval->str+yyleng-1)=0;
unput(';'); unput(';');
BEGIN(0); BEGIN(0);
return word; return word;

View File

@@ -1522,9 +1522,7 @@ YY_RULE_SETUP
{ {
STORE_LOC; STORE_LOC;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
/* XXX maybe the truncation should be unconditional ? */ yylval->str[yyleng-1] = '\0';
if(yyleng > 1)
*(yylval->str+yyleng-1)=0;
unput(';'); unput(';');
BEGIN(0); BEGIN(0);
return word; return word;
@@ -1533,7 +1531,7 @@ YY_RULE_SETUP
case 54: case 54:
/* rule 54 can match eol */ /* rule 54 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 389 "ael.flex" #line 387 "ael.flex"
{ {
FILE *in1; FILE *in1;
char fnamebuf[1024],*p1,*p2; char fnamebuf[1024],*p1,*p2;
@@ -1600,7 +1598,7 @@ case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(paren): case YY_STATE_EOF(paren):
case YY_STATE_EOF(semic): case YY_STATE_EOF(semic):
case YY_STATE_EOF(argg): case YY_STATE_EOF(argg):
#line 451 "ael.flex" #line 449 "ael.flex"
{ {
if ( --include_stack_index < 0 ) { if ( --include_stack_index < 0 ) {
yyterminate(); yyterminate();
@@ -1616,10 +1614,10 @@ case YY_STATE_EOF(argg):
YY_BREAK YY_BREAK
case 55: case 55:
YY_RULE_SETUP YY_RULE_SETUP
#line 464 "ael.flex" #line 462 "ael.flex"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 1623 "ael_lex.c" #line 1621 "ael_lex.c"
case YY_END_OF_BUFFER: case YY_END_OF_BUFFER:
{ {
@@ -2749,7 +2747,7 @@ void ael_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"
#line 464 "ael.flex" #line 462 "ael.flex"