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
4ed79243
Commit
4ed79243
authored
Mar 26, 2019
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix tolower implementation to not depend on locale.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
11401be9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
9 deletions
+33
-9
string.c
dlls/ntdll/string.c
+9
-9
string.c
dlls/ntdll/tests/string.c
+24
-0
No files found.
dlls/ntdll/string.c
View file @
4ed79243
...
...
@@ -218,6 +218,15 @@ void * __cdecl _memccpy( void *dst, const void *src, int c, size_t n )
/*********************************************************************
* tolower (NTDLL.@)
*/
int
__cdecl
NTDLL_tolower
(
int
c
)
{
return
(
char
)
c
>=
'A'
&&
(
char
)
c
<=
'Z'
?
c
-
'A'
+
'a'
:
c
;
}
/*********************************************************************
* _memicmp (NTDLL.@)
*
* Compare two blocks of memory as strings, ignoring case.
...
...
@@ -308,15 +317,6 @@ LPSTR __cdecl _strlwr( LPSTR str )
/*********************************************************************
* tolower (NTDLL.@)
*/
int
__cdecl
NTDLL_tolower
(
int
c
)
{
return
tolower
(
c
);
}
/*********************************************************************
* toupper (NTDLL.@)
*/
int
__cdecl
NTDLL_toupper
(
int
c
)
...
...
dlls/ntdll/tests/string.c
View file @
4ed79243
...
...
@@ -61,6 +61,7 @@ static void (__cdecl *p_qsort)(void *,size_t,size_t, int(__cdecl *compar)(co
static
void
*
(
__cdecl
*
p_bsearch
)(
void
*
,
void
*
,
size_t
,
size_t
,
int
(
__cdecl
*
compar
)(
const
void
*
,
const
void
*
)
);
static
int
(
WINAPIV
*
p__snprintf
)(
char
*
,
size_t
,
const
char
*
,
...);
static
int
(
__cdecl
*
p_tolower
)(
int
);
static
void
InitFunctionPtrs
(
void
)
{
...
...
@@ -99,6 +100,8 @@ static void InitFunctionPtrs(void)
p_bsearch
=
(
void
*
)
GetProcAddress
(
hntdll
,
"bsearch"
);
p__snprintf
=
(
void
*
)
GetProcAddress
(
hntdll
,
"_snprintf"
);
p_tolower
=
(
void
*
)
GetProcAddress
(
hntdll
,
"tolower"
);
}
/* if */
}
...
...
@@ -1327,6 +1330,26 @@ static void test__snprintf(void)
ok
(
!
strcmp
(
buffer
,
teststring
),
"_snprintf returned buffer '%s', expected '%s'.
\n
"
,
buffer
,
teststring
);
}
static
void
test_tolower
(
void
)
{
int
i
,
ret
,
exp_ret
;
if
(
!
GetProcAddress
(
GetModuleHandleA
(
"ntdll"
),
"NtRemoveIoCompletionEx"
))
{
win_skip
(
"tolower tests
\n
"
);
return
;
}
ok
(
p_tolower
!=
NULL
,
"tolower is not available
\n
"
);
for
(
i
=
-
512
;
i
<
512
;
i
++
)
{
exp_ret
=
(
char
)
i
>=
'A'
&&
(
char
)
i
<=
'Z'
?
i
-
'A'
+
'a'
:
i
;
ret
=
p_tolower
(
i
);
ok
(
ret
==
exp_ret
,
"tolower(%d) = %d
\n
"
,
i
,
ret
);
}
}
START_TEST
(
string
)
{
InitFunctionPtrs
();
...
...
@@ -1363,4 +1386,5 @@ START_TEST(string)
test_bsearch
();
if
(
p__snprintf
)
test__snprintf
();
test_tolower
();
}
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