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
fb5302c2
Commit
fb5302c2
authored
Feb 18, 2024
by
Daniel Lehman
Committed by
Alexandre Julliard
Feb 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use string sort for strcoll/wcscoll.
parent
188d8804
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
string.c
dlls/msvcrt/string.c
+2
-1
string.c
dlls/msvcrt/tests/string.c
+2
-5
wcs.c
dlls/msvcrt/wcs.c
+2
-1
No files found.
dlls/msvcrt/string.c
View file @
fb5302c2
...
...
@@ -1162,7 +1162,8 @@ int CDECL _strcoll_l( const char* str1, const char* str2, _locale_t locale )
if
(
!
locinfo
->
lc_handle
[
LC_COLLATE
])
return
strcmp
(
str1
,
str2
);
return
CompareStringA
(
locinfo
->
lc_handle
[
LC_COLLATE
],
0
,
str1
,
-
1
,
str2
,
-
1
)
-
CSTR_EQUAL
;
return
CompareStringA
(
locinfo
->
lc_handle
[
LC_COLLATE
],
SORT_STRINGSORT
,
str1
,
-
1
,
str2
,
-
1
)
-
CSTR_EQUAL
;
}
/*********************************************************************
...
...
dlls/msvcrt/tests/string.c
View file @
fb5302c2
...
...
@@ -4234,7 +4234,6 @@ static void test__tcscoll(void)
const
char
*
str1
;
const
char
*
str2
;
int
exp
;
BOOL
todo
;
};
static
const
struct
test
tests
[]
=
{
{
"English"
,
"ABCD"
,
"ABCD"
,
0
},
...
...
@@ -4242,8 +4241,8 @@ static void test__tcscoll(void)
{
"English"
,
"ABCD"
,
"ABC"
,
1
},
{
"English"
,
"ABCe"
,
"ABCf"
,
-
1
},
{
"English"
,
"abcd"
,
"ABCD"
,
-
1
},
{
"English"
,
"AB D"
,
"AB-D"
,
1
,
TRUE
},
{
"English"
,
"AB D"
,
"AB'D"
,
1
,
TRUE
},
{
"English"
,
"AB D"
,
"AB-D"
,
1
},
{
"English"
,
"AB D"
,
"AB'D"
,
1
},
{
"C"
,
"ABCD"
,
"ABCD"
,
0
},
{
"C"
,
"ABC"
,
"ABCD"
,
-
1
},
...
...
@@ -4284,7 +4283,6 @@ static void test__tcscoll(void)
ok
(
ret
<
0
,
"expected < 0, got %d for %s, %s for locale %s
\n
"
,
ret
,
str1
,
str2
,
tests
[
i
].
locale
);
else
todo_wine_if
(
tests
[
i
].
todo
)
ok
(
ret
>
0
,
"expected > 0, got %d for %s, %s for locale %s
\n
"
,
ret
,
str1
,
str2
,
tests
[
i
].
locale
);
...
...
@@ -4304,7 +4302,6 @@ static void test__tcscoll(void)
ok
(
ret
<
0
,
"expected < 0, got %d for %s, %s for locale %s
\n
"
,
ret
,
str1
,
str2
,
tests
[
i
].
locale
);
else
todo_wine_if
(
tests
[
i
].
todo
)
ok
(
ret
>
0
,
"expected > 0, got %d for %s, %s for locale %s
\n
"
,
ret
,
str1
,
str2
,
tests
[
i
].
locale
);
}
...
...
dlls/msvcrt/wcs.c
View file @
fb5302c2
...
...
@@ -1994,7 +1994,8 @@ int CDECL _wcscoll_l(const wchar_t* str1, const wchar_t* str2, _locale_t locale)
if
(
!
locinfo
->
lc_handle
[
LC_COLLATE
])
return
wcscmp
(
str1
,
str2
);
return
CompareStringW
(
locinfo
->
lc_handle
[
LC_COLLATE
],
0
,
str1
,
-
1
,
str2
,
-
1
)
-
CSTR_EQUAL
;
return
CompareStringW
(
locinfo
->
lc_handle
[
LC_COLLATE
],
SORT_STRINGSORT
,
str1
,
-
1
,
str2
,
-
1
)
-
CSTR_EQUAL
;
}
/*********************************************************************
...
...
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