aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/ael/ael.flex
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-30 23:31:43 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-30 23:31:43 +0000
commit105894039819384721c422229c476b51f5dff8d1 (patch)
treee67a0d0dc3b4d3638efef35a86807cfac332bc19 /pbx/ael/ael.flex
parent2746adf5a399b98e30fc95c77368d7814ba64036 (diff)
put back some simplifications, this time really tested
(ael_lex.c manually deleted, runtest passed) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23782 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/ael/ael.flex')
-rw-r--r--pbx/ael/ael.flex21
1 files changed, 7 insertions, 14 deletions
diff --git a/pbx/ael/ael.flex b/pbx/ael/ael.flex
index 45cd1e0d4..b4c785571 100644
--- a/pbx/ael/ael.flex
+++ b/pbx/ael/ael.flex
@@ -240,7 +240,7 @@ includes { STORE_POS; return KW_INCLUDES;}
} else {
STORE_LOC;
yylval->str = strdup(yytext);
- yylval->str[strlen(yylval->str)-1] = '\0'; /* trim trailing ')' */
+ yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
unput(')');
BEGIN(0);
return word;
@@ -290,19 +290,13 @@ includes { STORE_POS; return KW_INCLUDES;}
yymore();
} else {
STORE_LOC;
- yylval->str = strdup(yytext);
- if(yyleng > 1 )
- yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
BEGIN(0);
- if ( !strcmp(yylval->str,")") ) {
- free(yylval->str);
- yylval->str = 0;
- my_col++; /* XXX why ? */
+ if ( !strcmp(yytext, ")") )
return RP;
- } else {
- unput(')');
- return word;
- }
+ yylval->str = strdup(yytext);
+ yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
+ unput(')');
+ return word;
}
}
@@ -321,8 +315,7 @@ includes { STORE_POS; return KW_INCLUDES;}
/* printf("Got argg2 word %s\n", yylval->str); */
unput(',');
commaout = 1;
- if (yyleng > 1 )
- *(yylval->str+yyleng-1)=0;
+ yylval->str[yyleng-1] = '\0';
return word;
} else {
commaout = 0;