[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690
Alexandre Julliard
julliard at winehq.org
Sun Jun 17 20:03:19 UTC 2012
The following commit has been merged in the wheezy branch:
commit 072175349d6aee3bf4d808cbd5f3c11f5a8c8d55
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Apr 20 11:08:08 2012 +0200
jscript: Added regexp 'pre-parser' to support non-backslash-sequenced non-terminating '/' in characted classes.
(cherry picked from commit 4733fd062391a2d975771df53cdda058141dbc80)
diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c
index 4cf4d41..355c25f 100644
--- a/dlls/jscript/lex.c
+++ b/dlls/jscript/lex.c
@@ -957,6 +957,7 @@ int parser_lex(void *lval, parser_ctx_t *ctx)
literal_t *parse_regexp(parser_ctx_t *ctx)
{
const WCHAR *re, *flags_ptr;
+ BOOL in_class = FALSE;
DWORD re_len, flags;
literal_t *ret;
HRESULT hres;
@@ -965,14 +966,29 @@ literal_t *parse_regexp(parser_ctx_t *ctx)
while(*--ctx->ptr != '/');
+ /* Simple regexp pre-parser; '/' if used in char class does not terminate regexp literal */
re = ++ctx->ptr;
- while(ctx->ptr < ctx->end && *ctx->ptr != '/') {
- if(*ctx->ptr++ == '\\' && ctx->ptr < ctx->end)
- ctx->ptr++;
+ while(ctx->ptr < ctx->end) {
+ if(*ctx->ptr == '\\') {
+ if(++ctx->ptr == ctx->end)
+ break;
+ }else if(in_class) {
+ if(*ctx->ptr == '\n')
+ break;
+ if(*ctx->ptr == ']')
+ in_class = FALSE;
+ }else {
+ if(*ctx->ptr == '/')
+ break;
+
+ if(*ctx->ptr == '[')
+ in_class = TRUE;
+ }
+ ctx->ptr++;
}
- if(ctx->ptr == ctx->end) {
- WARN("unexpected end of file\n");
+ if(ctx->ptr == ctx->end || *ctx->ptr != '/') {
+ WARN("pre-parsing failed\n");
return NULL;
}
--
Debian Wine packaging
More information about the pkg-wine-party
mailing list