This patch fixes a problem with 8-bit input to the ast_expr2 scanner.

The real culprit was the --full argument to flex
in the Makefile! This causes a 7-bit scanner to be
generated.

I reviewed the rules and found one rule where I needed
to specifically include 8-bit chars for a token.

I tested against the text supplied by ibercom, and 
all looks very well.

This has been there a surprisingly long time!


(closes issue #14498)
Reported by: ibercom
Patches:
      14498.patch uploaded by murf (license 17)
Tested by: murf


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Steve Murphy
2009-02-19 22:51:37 +00:00
parent 4675032a30
commit d290eed8e0
3 changed files with 198 additions and 1018 deletions

View File

@@ -105,7 +105,7 @@ ast_expr2.c ast_expr2.h:
bison -o $@ -d --name-prefix=ast_yy ast_expr2.y bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
ast_expr2f.c: ast_expr2f.c:
flex -o $@ --full ast_expr2.fl # moved the correction of yyfree into the flex input file itself. flex -o $@ ast_expr2.fl # moved the correction of yyfree into the flex input file itself.
sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ast_expr2f.c > zz sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ast_expr2f.c > zz
mv zz ast_expr2f.c mv zz ast_expr2f.c

View File

@@ -102,6 +102,8 @@ static char *expr2_token_subst(const char *mess);
%option noyyfree %option noyyfree
%x var trail %x var trail
HIBIT [\x80-\xff]
%% %%
\| { SET_COLUMNS; SET_STRING; return TOK_OR;} \| { SET_COLUMNS; SET_STRING; return TOK_OR;}
@@ -150,7 +152,7 @@ static char *expr2_token_subst(const char *mess);
return TOKEN; return TOKEN;
} }
[a-zA-Z0-9,.';\\_^$#@]+ { [a-zA-Z0-9,.';\\_^$#@{HIBIT}]+ {
SET_COLUMNS; SET_COLUMNS;
SET_STRING; SET_STRING;
return TOKEN; return TOKEN;

File diff suppressed because it is too large Load Diff