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
841fbd5b
Commit
841fbd5b
authored
Jul 14, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't use strcmpW in wcscmp.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2a12ccd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
string.c
dlls/msvcrt/tests/string.c
+15
-0
wcs.c
dlls/msvcrt/wcs.c
+19
-9
No files found.
dlls/msvcrt/tests/string.c
View file @
841fbd5b
...
...
@@ -4210,6 +4210,20 @@ static void test_iswdigit(void)
}
}
static
void
test_wcscmp
(
void
)
{
int
r
;
r
=
wcscmp
(
L"a"
,
L"z"
);
ok
(
r
==
-
1
,
"wcscmp returned %d
\n
"
,
r
);
r
=
wcscmp
(
L"z"
,
L"a"
);
ok
(
r
==
1
,
"wcscmp returned %d
\n
"
,
r
);
r
=
wcscmp
(
L"f"
,
L"f"
);
ok
(
!
r
,
"wcscmp returned %d
\n
"
,
r
);
}
START_TEST
(
string
)
{
char
mem
[
100
];
...
...
@@ -4359,4 +4373,5 @@ START_TEST(string)
test_C_locale
();
test_strstr
();
test_iswdigit
();
test_wcscmp
();
}
dlls/msvcrt/wcs.c
View file @
841fbd5b
...
...
@@ -1584,6 +1584,24 @@ int WINAPIV MSVCRT_swprintf_p_l(MSVCRT_wchar_t *buffer, MSVCRT_size_t length,
}
/*********************************************************************
* wcscmp (MSVCRT.@)
*/
int
CDECL
MSVCRT_wcscmp
(
const
MSVCRT_wchar_t
*
str1
,
const
MSVCRT_wchar_t
*
str2
)
{
while
(
*
str1
&&
(
*
str1
==
*
str2
))
{
str1
++
;
str2
++
;
}
if
(
*
str1
<
*
str2
)
return
-
1
;
if
(
*
str1
>
*
str2
)
return
1
;
return
0
;
}
/*********************************************************************
* _wcscoll_l (MSVCRT.@)
*/
int
CDECL
MSVCRT__wcscoll_l
(
const
MSVCRT_wchar_t
*
str1
,
const
MSVCRT_wchar_t
*
str2
,
MSVCRT__locale_t
locale
)
...
...
@@ -1596,7 +1614,7 @@ int CDECL MSVCRT__wcscoll_l(const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t* st
locinfo
=
locale
->
locinfo
;
if
(
!
locinfo
->
lc_handle
[
MSVCRT_LC_COLLATE
])
return
strcmpW
(
str1
,
str2
);
return
MSVCRT_wcscmp
(
str1
,
str2
);
return
CompareStringW
(
locinfo
->
lc_handle
[
MSVCRT_LC_COLLATE
],
0
,
str1
,
-
1
,
str2
,
-
1
)
-
CSTR_EQUAL
;
}
...
...
@@ -2668,11 +2686,3 @@ MSVCRT_size_t CDECL MSVCRT_wcsxfrm(MSVCRT_wchar_t *dest,
{
return
MSVCRT__wcsxfrm_l
(
dest
,
src
,
len
,
NULL
);
}
/*********************************************************************
* wcscmp (MSVCRT.@)
*/
int
CDECL
MSVCRT_wcscmp
(
const
MSVCRT_wchar_t
*
str1
,
const
MSVCRT_wchar_t
*
str2
)
{
return
strcmpW
(
str1
,
str2
);
}
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