Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d71e9394
Commit
d71e9394
authored
Jul 12, 2023
by
Victor Chiletto
Committed by
Alexandre Julliard
Jul 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Simplify set_lc_locale_name.
parent
72c3b8f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
16 deletions
+4
-16
locale.c
dlls/msvcrt/locale.c
+4
-16
No files found.
dlls/msvcrt/locale.c
View file @
d71e9394
...
...
@@ -471,32 +471,20 @@ static BOOL init_category_name(const char *name, int len,
}
#if _MSVCR_VER >= 110
static
inline
BOOL
set_lc_locale_name
(
pthreadlocinfo
locinfo
,
int
cat
)
static
inline
BOOL
set_lc_locale_name
(
pthreadlocinfo
locinfo
,
int
cat
,
WCHAR
*
sname
)
{
LCID
lcid
=
locinfo
->
lc_handle
[
cat
];
WCHAR
buf
[
100
];
int
len
;
locinfo
->
lc_category
[
cat
].
wrefcount
=
malloc
(
sizeof
(
int
));
if
(
!
locinfo
->
lc_category
[
cat
].
wrefcount
)
return
FALSE
;
*
locinfo
->
lc_category
[
cat
].
wrefcount
=
1
;
len
=
GetLocaleInfoW
(
lcid
,
LOCALE_SISO639LANGNAME
|
LOCALE_NOUSEROVERRIDE
,
buf
,
100
);
if
(
!
len
)
return
FALSE
;
if
(
LocaleNameToLCID
(
buf
,
LOCALE_ALLOW_NEUTRAL_NAMES
)
!=
lcid
)
len
=
LCIDToLocaleName
(
lcid
,
buf
,
100
,
LOCALE_ALLOW_NEUTRAL_NAMES
);
if
(
!
len
||
!
(
locinfo
->
lc_name
[
cat
]
=
malloc
(
len
*
sizeof
(
wchar_t
))))
if
(
!
(
locinfo
->
lc_name
[
cat
]
=
wcsdup
(
sname
)))
return
FALSE
;
memcpy
(
locinfo
->
lc_name
[
cat
],
buf
,
len
*
sizeof
(
wchar_t
));
return
TRUE
;
}
#else
static
inline
BOOL
set_lc_locale_name
(
pthreadlocinfo
locinfo
,
int
cat
)
static
inline
BOOL
set_lc_locale_name
(
pthreadlocinfo
locinfo
,
int
cat
,
WCHAR
*
sname
)
{
return
TRUE
;
}
...
...
@@ -531,7 +519,7 @@ static BOOL update_threadlocinfo_category(WCHAR *sname, unsigned short cp,
locinfo
->
lc_handle
[
category
]
=
LocaleNameToLCID
(
sname
,
LCID_CONVERSION_FLAGS
);
set_lc_locale_name
(
locinfo
,
category
);
set_lc_locale_name
(
locinfo
,
category
,
sname
);
if
(
!
locinfo
->
lc_category
[
category
].
locale
)
{
char
buf
[
256
];
...
...
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