[asterisk-commits] trunk r23806 - in /trunk/pbx/ael: ael.flex ael_lex.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Apr 30 17:27:28 MST 2006


Author: rizzo
Date: Sun Apr 30 19:27:27 2006
New Revision: 23806

URL: http://svn.digium.com/view/asterisk?rev=23806&view=rev
Log:
always trim the trailing ';'


Modified:
    trunk/pbx/ael/ael.flex
    trunk/pbx/ael/ael_lex.c

Modified: trunk/pbx/ael/ael.flex
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael.flex?rev=23806&r1=23805&r2=23806&view=diff
==============================================================================
--- trunk/pbx/ael/ael.flex (original)
+++ trunk/pbx/ael/ael.flex Sun Apr 30 19:27:27 2006
@@ -378,9 +378,7 @@
 <semic>{NOSEMIC};	{
 		STORE_LOC;
 		yylval->str = strdup(yytext);
-		/* XXX maybe the truncation should be unconditional ? */
-		if(yyleng > 1)
-			*(yylval->str+yyleng-1)=0;
+		yylval->str[yyleng-1] = '\0';
 		unput(';');
 		BEGIN(0);
 		return word;

Modified: trunk/pbx/ael/ael_lex.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/ael/ael_lex.c?rev=23806&r1=23805&r2=23806&view=diff
==============================================================================
--- trunk/pbx/ael/ael_lex.c (original)
+++ trunk/pbx/ael/ael_lex.c Sun Apr 30 19:27:27 2006
@@ -1522,9 +1522,7 @@
 {
 		STORE_LOC;
 		yylval->str = strdup(yytext);
-		/* XXX maybe the truncation should be unconditional ? */
-		if(yyleng > 1)
-			*(yylval->str+yyleng-1)=0;
+		yylval->str[yyleng-1] = '\0';
 		unput(';');
 		BEGIN(0);
 		return word;
@@ -1533,7 +1531,7 @@
 case 54:
 /* rule 54 can match eol */
 YY_RULE_SETUP
-#line 389 "ael.flex"
+#line 387 "ael.flex"
 {
 		FILE *in1;
 		char fnamebuf[1024],*p1,*p2;
@@ -1600,7 +1598,7 @@
 case YY_STATE_EOF(paren):
 case YY_STATE_EOF(semic):
 case YY_STATE_EOF(argg):
-#line 451 "ael.flex"
+#line 449 "ael.flex"
 {
 		if ( --include_stack_index < 0 ) {
 			yyterminate();
@@ -1616,10 +1614,10 @@
 	YY_BREAK
 case 55:
 YY_RULE_SETUP
-#line 464 "ael.flex"
+#line 462 "ael.flex"
 ECHO;
 	YY_BREAK
-#line 1623 "ael_lex.c"
+#line 1621 "ael_lex.c"
 
 	case YY_END_OF_BUFFER:
 		{
@@ -2749,7 +2747,7 @@
 
 #define YYTABLES_NAME "yytables"
 
-#line 464 "ael.flex"
+#line 462 "ael.flex"
 
 
 



More information about the asterisk-commits mailing list