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
b7233c84
Commit
b7233c84
authored
Oct 19, 1998
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 19, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug on platforms were buffers returned by getenv() shall not be
free()'ed. Added French (default) in locale handling.
parent
0a56c4f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
30 deletions
+41
-30
ole2nls.c
ole/ole2nls.c
+41
-30
No files found.
ole/ole2nls.c
View file @
b7233c84
...
...
@@ -360,39 +360,46 @@ LCID WINAPI GetSystemDefaultLCID()
*/
LANGID
WINAPI
GetUserDefaultLangID
()
{
char
*
buf
=
NULL
;
char
*
lang
,
*
country
,
*
charset
,
*
dialect
,
*
next
;
int
ret
=
0
;
/* caching result, if defined from environment, which should (?) not change during a WINE session */
static
LANGID
userLCID
=
0
;
if
(
Options
.
language
)
return
Languages
[
Options
.
language
].
langid
;
buf
=
getenv
(
"LANGUAGE"
);
if
(
!
buf
)
buf
=
getenv
(
"LANG"
);
if
(
!
buf
)
buf
=
getenv
(
"LC_ALL"
);
if
(
!
buf
)
buf
=
getenv
(
"LC_MESSAGES"
);
if
(
!
buf
)
return
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
);
if
(
!
strcmp
(
buf
,
"POSIX"
)
||
!
strcmp
(
buf
,
"C"
))
{
free
(
buf
);
return
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
);
if
(
Options
.
language
)
{
return
Languages
[
Options
.
language
].
langid
;
}
lang
=
buf
;
do
{
next
=
strchr
(
lang
,
':'
);
if
(
next
)
*
next
++=
'\0'
;
dialect
=
strchr
(
lang
,
'@'
);
if
(
dialect
)
*
dialect
++=
'\0'
;
charset
=
strchr
(
lang
,
'.'
);
if
(
charset
)
*
charset
++=
'\0'
;
country
=
strchr
(
lang
,
'_'
);
if
(
country
)
*
country
++=
'\0'
;
ret
=
MAIN_GetLanguageID
(
lang
,
country
,
charset
,
dialect
);
lang
=
next
;
}
while
(
lang
&&
!
ret
);
free
(
buf
);
return
(
LANGID
)
ret
;
if
(
userLCID
==
0
)
{
char
*
buf
=
NULL
;
char
*
lang
,
*
country
,
*
charset
,
*
dialect
,
*
next
;
int
ret
=
0
;
buf
=
getenv
(
"LANGUAGE"
);
if
(
!
buf
)
buf
=
getenv
(
"LANG"
);
if
(
!
buf
)
buf
=
getenv
(
"LC_ALL"
);
if
(
!
buf
)
buf
=
getenv
(
"LC_MESSAGES"
);
if
(
!
buf
)
return
userLCID
=
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
);
if
(
!
strcmp
(
buf
,
"POSIX"
)
||
!
strcmp
(
buf
,
"C"
))
{
return
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
);
}
lang
=
buf
;
do
{
next
=
strchr
(
lang
,
':'
);
if
(
next
)
*
next
++=
'\0'
;
dialect
=
strchr
(
lang
,
'@'
);
if
(
dialect
)
*
dialect
++=
'\0'
;
charset
=
strchr
(
lang
,
'.'
);
if
(
charset
)
*
charset
++=
'\0'
;
country
=
strchr
(
lang
,
'_'
);
if
(
country
)
*
country
++=
'\0'
;
ret
=
MAIN_GetLanguageID
(
lang
,
country
,
charset
,
dialect
);
lang
=
next
;
}
while
(
lang
&&
!
ret
);
/* FIXME : are strings returned by getenv() to be free()'ed ? */
userLCID
=
(
LANGID
)
ret
;
}
return
userLCID
;
}
/***********************************************************************
...
...
@@ -496,6 +503,10 @@ LANG_BEGIN (LANG_FINNISH, SUBLANG_DEFAULT) /*0x040B*/
#include "nls/fin.nls"
LANG_END
LANG_BEGIN
(
LANG_FRENCH
,
SUBLANG_DEFAULT
)
/*0x040C*/
#include "nls/fra.nls"
LANG_END
LANG_BEGIN
(
LANG_ITALIAN
,
SUBLANG_ITALIAN
)
/*0x410*/
#include "nls/ita.nls"
LANG_END
...
...
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