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
c63a0858
Commit
c63a0858
authored
Nov 28, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Don't return a parent locale for neutral locales in GetLocaleInfoEx.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ed46a326
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
locale.c
dlls/kernel32/locale.c
+13
-7
locale.c
dlls/kernel32/tests/locale.c
+8
-0
No files found.
dlls/kernel32/locale.c
View file @
c63a0858
...
...
@@ -1807,16 +1807,22 @@ INT WINAPI GetLocaleInfoEx(LPCWSTR locale, LCTYPE info, LPWSTR buffer, INT len)
if
(
!
lcid
)
return
0
;
/* special handling for neutral locale names */
if
(
info
==
LOCALE_SNAME
&&
locale
&&
strlenW
(
locale
)
==
2
)
if
(
locale
&&
strlenW
(
locale
)
==
2
)
{
if
(
len
&&
len
<
3
)
switch
(
info
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
0
;
case
LOCALE_SNAME
:
if
(
len
&&
len
<
3
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
0
;
}
if
(
len
)
strcpyW
(
buffer
,
locale
);
return
3
;
case
LOCALE_SPARENT
:
if
(
len
)
buffer
[
0
]
=
0
;
return
1
;
}
if
(
len
)
strcpyW
(
buffer
,
locale
);
return
3
;
}
return
GetLocaleInfoW
(
lcid
,
info
,
buffer
,
len
);
...
...
dlls/kernel32/tests/locale.c
View file @
c63a0858
...
...
@@ -4483,6 +4483,14 @@ static void test_GetLocaleInfoEx(void)
ok
(
ret
==
lstrlenW
(
bufferW
)
+
1
,
"got %d
\n
"
,
ret
);
ok
(
!
lstrcmpW
(
bufferW
,
enuW
),
"got %s
\n
"
,
wine_dbgstr_w
(
bufferW
));
ret
=
pGetLocaleInfoEx
(
enusW
,
LOCALE_SPARENT
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
WCHAR
));
ok
(
ret
==
lstrlenW
(
bufferW
)
+
1
,
"got %d
\n
"
,
ret
);
ok
(
!
lstrcmpW
(
bufferW
,
enW
),
"got %s
\n
"
,
wine_dbgstr_w
(
bufferW
));
ret
=
pGetLocaleInfoEx
(
enW
,
LOCALE_SPARENT
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
WCHAR
));
ok
(
ret
==
1
,
"got %d
\n
"
,
ret
);
ok
(
!
bufferW
[
0
],
"got %s
\n
"
,
wine_dbgstr_w
(
bufferW
));
ret
=
pGetLocaleInfoEx
(
enW
,
LOCALE_SCOUNTRY
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
WCHAR
));
ok
(
ret
==
lstrlenW
(
bufferW
)
+
1
,
"got %d
\n
"
,
ret
);
if
((
PRIMARYLANGID
(
LANGIDFROMLCID
(
GetSystemDefaultLCID
()))
!=
LANG_ENGLISH
)
||
...
...
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