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
22d7f141
Commit
22d7f141
authored
Jun 21, 2006
by
Juan Lang
Committed by
Alexandre Julliard
Jun 22, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Use the WinXP method for comparing strings with embedded NULLs. Update tests.
parent
16449744
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
locale.c
dlls/kernel/tests/locale.c
+12
-2
sortkey.c
libs/unicode/sortkey.c
+2
-3
No files found.
dlls/kernel/tests/locale.c
View file @
22d7f141
...
...
@@ -928,11 +928,21 @@ static void test_CompareStringA(void)
ret
=
CompareStringA
(
LOCALE_USER_DEFAULT
,
0
,
"aLuZkUtZ"
,
7
,
"aLuZkUtZ
\0
A"
,
10
);
ok
(
ret
==
1
,
"aLuZkUtZ vs aLuZkUtZ
\\
0A expected 1, got %d
\n
"
,
ret
);
/* WinXP handles embedded NULLs differently than earlier versions */
ret
=
CompareStringA
(
LOCALE_USER_DEFAULT
,
0
,
"aLuZkUtZ"
,
8
,
"aLuZkUtZ
\0
A"
,
10
);
ok
(
ret
==
2
,
"aLuZkUtZ vs aLuZkUtZ
\\
0A expected
2, got %d
\n
"
,
ret
);
ok
(
ret
==
1
||
ret
==
2
,
"aLuZkUtZ vs aLuZkUtZ
\\
0A expected 1 or
2, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
LOCALE_USER_DEFAULT
,
0
,
"aLu
\0
ZkUtZ"
,
8
,
"aLu
\0
ZkUtZ
\0
A"
,
10
);
ok
(
ret
==
2
,
"aLu
\\
0ZkUtZ vs aLu
\\
0ZkUtZ
\\
0A expected 2, got %d
\n
"
,
ret
);
ok
(
ret
==
1
||
ret
==
2
,
"aLu
\\
0ZkUtZ vs aLu
\\
0ZkUtZ
\\
0A expected 1 or 2, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
lcid
,
0
,
"a
\0
b"
,
-
1
,
"a"
,
-
1
);
ok
(
ret
==
2
,
"a vs a expected 2, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
lcid
,
0
,
"a
\0
b"
,
4
,
"a"
,
2
);
ok
(
ret
==
3
,
"a
\\
0b vs a expected 3, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
lcid
,
0
,
"
\1\0\2
"
,
4
,
"
\1\0\1
"
,
4
);
todo_wine
ok
(
ret
!=
2
,
"
\\
1
\\
0
\\
2 vs
\\
1
\\
0
\\
1 expected unequal
\n
"
);
}
static
void
test_LCMapStringA
(
void
)
...
...
libs/unicode/sortkey.c
View file @
22d7f141
...
...
@@ -326,9 +326,8 @@ static inline int compare_case_weights(int flags, const WCHAR *str1, int len1,
static
inline
int
real_length
(
const
WCHAR
*
str
,
int
len
)
{
int
real_len
=
0
;
while
(
len
--
&&
*
str
++
)
real_len
++
;
return
real_len
;
while
(
len
&&
!
str
[
len
-
1
])
len
--
;
return
len
;
}
int
wine_compare_string
(
int
flags
,
const
WCHAR
*
str1
,
int
len1
,
...
...
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