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
f11dfcb7
Commit
f11dfcb7
authored
Apr 19, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix multiple locales parsing in _create_locale.
parent
97bad691
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
locale.c
dlls/msvcrt/locale.c
+12
-10
No files found.
dlls/msvcrt/locale.c
View file @
f11dfcb7
...
...
@@ -214,8 +214,8 @@ static LCID MSVCRT_locale_to_LCID(const char *locale)
if
(
cp
)
{
lstrcpynA
(
search
.
search_codepage
,
cp
+
1
,
MAX_ELEM_LEN
);
if
(
cp
-
region
<
MAX_ELEM_LEN
)
search
.
search_country
[
cp
-
region
]
=
'\0'
;
if
(
cp
-
region
-
1
<
MAX_ELEM_LEN
)
search
.
search_country
[
cp
-
region
-
1
]
=
'\0'
;
if
(
cp
-
locale
<
MAX_ELEM_LEN
)
search
.
search_language
[
cp
-
locale
]
=
'\0'
;
}
else
...
...
@@ -229,11 +229,11 @@ static LCID MSVCRT_locale_to_LCID(const char *locale)
(
LONG_PTR
)
&
search
);
if
(
!
search
.
match_flags
)
return
0
;
return
-
1
;
/* If we were given something that didn't match, fail */
if
(
search
.
search_country
[
0
]
&&
!
(
search
.
match_flags
&
FOUND_COUNTRY
))
return
0
;
return
-
1
;
lcid
=
MAKELCID
(
search
.
found_lang_id
,
SORT_DEFAULT
);
...
...
@@ -253,10 +253,10 @@ static LCID MSVCRT_locale_to_LCID(const char *locale)
GetLocaleInfoA
(
lcid
,
LOCALE_IDEFAULTANSICODEPAGE
,
search
.
found_codepage
,
MAX_ELEM_LEN
);
}
else
return
0
;
return
-
1
;
if
(
!
atoi
(
search
.
found_codepage
))
return
0
;
return
-
1
;
}
}
else
{
/* Prefer ANSI codepages if present */
...
...
@@ -583,23 +583,25 @@ MSVCRT__locale_t _create_locale(int category, const char *locale)
return
NULL
;
p
=
strchr
(
locale
,
';'
);
if
(
p
)
{
if
(
locale
[
0
]
==
'C'
&&
(
locale
[
1
]
==
';'
||
locale
[
1
]
==
'\0'
))
lcid
[
i
]
=
0
;
else
if
(
p
)
{
memcpy
(
buf
,
locale
,
p
-
locale
);
lcid
[
i
]
=
MSVCRT_locale_to_LCID
(
buf
);
}
else
lcid
[
i
]
=
MSVCRT_locale_to_LCID
(
locale
);
if
(
!
lcid
[
i
]
)
if
(
lcid
[
i
]
==
-
1
)
return
NULL
;
if
(
!
p
||
*
(
p
+
1
)
!=
'L'
||
*
(
p
+
2
)
!=
'C'
||
*
(
p
+
3
)
!=
'_'
)
break
;
locale
=
p
+
4
;
locale
=
p
+
1
;
}
}
else
{
lcid
[
0
]
=
MSVCRT_locale_to_LCID
(
locale
);
if
(
!
lcid
[
0
]
)
if
(
lcid
[
0
]
==
-
1
)
return
NULL
;
}
...
...
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