summaryrefslogtreecommitdiff
path: root/pbx/ael/ael_lex.c
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2006-04-28 15:24:30 +0000
committerLuigi Rizzo <rizzo@icir.org>2006-04-28 15:24:30 +0000
commitc1366df3d577ff9e936d02a3e106b9577925a45a (patch)
tree0f661fe3828c26398d0557c135e2e5d395620609 /pbx/ael/ael_lex.c
parent799126216eccca77aa5ad5a4a163a87ff7e38949 (diff)
fix a bug in computing line numbers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx/ael/ael_lex.c')
-rw-r--r--pbx/ael/ael_lex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pbx/ael/ael_lex.c b/pbx/ael/ael_lex.c
index b1aa53f51..62aad1370 100644
--- a/pbx/ael/ael_lex.c
+++ b/pbx/ael/ael_lex.c
@@ -694,7 +694,7 @@ static int commaout = 0;
* current line, column and filename, updated as we read the input.
*/
static int my_lineno = 1; /* current line in the source */
-static int my_col = 0; /* current column in the source */
+static int my_col = 1; /* current column in the source */
char *my_file = 0; /* used also in the bison code */
char *prev_word; /* XXX document it */
@@ -771,7 +771,7 @@ static void pbcwhere(const char *text, int *line, int *col )
#define STORE_END do { \
pbcwhere(yytext, &my_lineno, &my_col); \
yylloc->last_line = my_lineno; \
- yylloc->last_column = my_col; \
+ yylloc->last_column = my_col - 1; \
} while (0)
#else
#define STORE_POS
@@ -1365,7 +1365,7 @@ YY_RULE_SETUP
#line 254 "ael.flex"
{
char c = yytext[yyleng-1];
- STORE_START;
+ // STORE_START;
if (c == '(')
parencount++;
pbcpush(c);
@@ -1417,11 +1417,11 @@ YY_RULE_SETUP
return word;
}
- STORE_END;
parencount--;
if( parencount >= 0){
yymore();
} else {
+ STORE_END;
yylval->str = strdup(yytext);
if(yyleng > 1 )
*(yylval->str+yyleng-1)=0;