Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9ac79498
Commit
9ac79498
authored
Dec 03, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Correctly handle -1 index in regexp match result.
parent
bd715dc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
regexp.c
dlls/jscript/regexp.c
+7
-2
regexp.js
dlls/jscript/tests/regexp.js
+5
-0
No files found.
dlls/jscript/regexp.c
View file @
9ac79498
...
...
@@ -3349,8 +3349,13 @@ static HRESULT do_regexp_match_next(script_ctx_t *ctx, RegExpInstance *regexp, c
*
parens_cnt
=
regexp
->
jsregexp
->
parenCount
;
for
(
i
=
0
;
i
<
regexp
->
jsregexp
->
parenCount
;
i
++
)
{
(
*
parens
)[
i
].
str
=
*
cp
+
result
->
parens
[
i
].
index
;
(
*
parens
)[
i
].
len
=
result
->
parens
[
i
].
length
;
if
(
result
->
parens
[
i
].
index
==
-
1
)
{
(
*
parens
)[
i
].
str
=
NULL
;
(
*
parens
)[
i
].
len
=
0
;
}
else
{
(
*
parens
)[
i
].
str
=
*
cp
+
result
->
parens
[
i
].
index
;
(
*
parens
)[
i
].
len
=
result
->
parens
[
i
].
length
;
}
}
}
...
...
dlls/jscript/tests/regexp.js
View file @
9ac79498
...
...
@@ -71,6 +71,11 @@ m = re.exec();
ok
(
m
===
null
,
"m is not null"
);
ok
(
re
.
lastIndex
===
0
,
"re.lastIndex = "
+
re
.
lastIndex
);
m
=
/
(
a|b
)
+|
(
c
)
/
.
exec
(
"aa"
);
ok
(
m
[
0
]
===
"aa"
,
"m[0] = "
+
m
[
0
]);
ok
(
m
[
1
]
===
"a"
,
"m[1] = "
+
m
[
1
]);
ok
(
m
[
2
]
===
""
,
"m[2] = "
+
m
[
2
]);
b
=
re
.
test
(
" a "
);
ok
(
b
===
true
,
"re.test(' a ') returned "
+
b
);
ok
(
re
.
lastIndex
===
3
,
"re.lastIndex = "
+
re
.
lastIndex
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment