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
28cc0b8b
Commit
28cc0b8b
authored
Mar 13, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Improve toupper_l implementation.
parent
13f6194b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
ctype.c
dlls/msvcrt/ctype.c
+22
-17
No files found.
dlls/msvcrt/ctype.c
View file @
28cc0b8b
...
...
@@ -339,37 +339,42 @@ int CDECL MSVCRT___iscsymf(int c)
int
CDECL
MSVCRT__toupper_l
(
int
c
,
MSVCRT__locale_t
locale
)
{
MSVCRT_pthreadlocinfo
locinfo
;
unsigned
char
str
[
2
],
*
p
=
str
;
WCHAR
wide
,
upper
;
if
(
!
locale
)
locinfo
=
get_locinfo
();
else
locinfo
=
locale
->
locinfo
;
if
(
c
<
256
)
return
locinfo
->
pcumap
[
(
unsigned
char
)
c
];
if
(
(
unsigned
)
c
<
256
)
return
locinfo
->
pcumap
[
c
];
if
(
locinfo
->
pctype
[(
c
>>
8
)
&
255
]
&
MSVCRT__LEADBYTE
)
{
WCHAR
wide
,
upper
;
char
str
[
2
],
*
p
=
str
;
*
p
++
=
(
c
>>
8
)
&
255
;
*
p
++
=
c
&
255
;
if
(
!
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
MB_ERR_INVALID_CHARS
,
str
,
2
,
&
wide
,
1
))
return
c
;
else
{
*
MSVCRT__errno
()
=
MSVCRT_EILSEQ
;
str
[
1
]
=
0
;
}
*
p
++
=
c
&
255
;
upper
=
toupperW
(
wide
);
if
(
upper
==
wide
)
return
c
;
if
(
!
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
MB_ERR_INVALID_CHARS
,
(
char
*
)
str
,
p
-
str
,
&
wide
,
1
)
)
return
c
;
WideCharToMultiByte
(
locinfo
->
lc_codepage
,
0
,
&
upper
,
1
,
str
,
2
,
NULL
,
NULL
);
upper
=
toupperW
(
wide
);
if
(
upper
==
wide
)
return
str
[
0
]
+
(
str
[
1
]
<<
8
);
switch
(
WideCharToMultiByte
(
locinfo
->
lc_codepage
,
0
,
&
upper
,
1
,
(
char
*
)
str
,
2
,
NULL
,
NULL
))
{
case
0
:
return
c
;
case
1
:
return
str
[
0
];
default:
return
str
[
0
]
+
(
str
[
1
]
<<
8
);
}
return
c
;
}
/*********************************************************************
...
...
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