X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fparser.lex;h=a4338e8f56b72974e4a4c31e267d0750aff8e951;hp=297bab226d82210ee0f9ad123bf72461d6d4ddde;hb=c63b2bf21dc1df9a736f0b4c08f6cba828cdab92;hpb=cba7006af456286786a63ff43c47bfe13e201497 diff --git a/src/parser.lex b/src/parser.lex index 297bab2..a4338e8 100644 --- a/src/parser.lex +++ b/src/parser.lex @@ -38,7 +38,7 @@ static void unescapeString(string_t * tmp) /* fixme - this routine expects the string to be null-terminated */ - for (p1=tmp->str; (p=strchr(p1, '\\')); p1 = p+1) + for (p1=(char*)tmp->str; (p=strchr(p1, '\\')); p1 = p+1) { int nr=2; int new=1; @@ -157,18 +157,21 @@ static void store(enum type_t type, int line, int column, char*text, int length) } #define MAX_INCLUDE_DEPTH 16 -YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; -int line_stack[MAX_INCLUDE_DEPTH]; -int column_stack[MAX_INCLUDE_DEPTH]; -int include_stack_ptr = 0; +static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; +static int line_stack[MAX_INCLUDE_DEPTH]; +static int column_stack[MAX_INCLUDE_DEPTH]; +static int include_stack_ptr = 0; -void handleInclude(char*text, int len) +static void handleInclude(char*text, int len) { text+=9;len-=9; while(len >=1 && (text[0] == ' ' || text[0] == '\t')) { text++;len--; } - while(len >= 1 && (text[len-1] == ' ' || text[len-1] == '\n')) { + while(len >= 1 && + (text[len-1] == ' ' || + text[len-1] == '\r' || + text[len-1] == '\n')) { len--; } if(len >= 2 && text[0] == '"' && text[len-1] == '"') {