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()
...
@@ -360,39 +360,46 @@ LCID WINAPI GetSystemDefaultLCID()
*/
*/
LANGID
WINAPI
GetUserDefaultLangID
()
LANGID
WINAPI
GetUserDefaultLangID
()
{
{
char
*
buf
=
NULL
;
/* caching result, if defined from environment, which should (?) not change during a WINE session */
char
*
lang
,
*
country
,
*
charset
,
*
dialect
,
*
next
;
static
LANGID
userLCID
=
0
;
int
ret
=
0
;
if
(
Options
.
language
)
return
Languages
[
Options
.
language
].
langid
;
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
);
}
}
lang
=
buf
;
if
(
userLCID
==
0
)
{
char
*
buf
=
NULL
;
do
{
char
*
lang
,
*
country
,
*
charset
,
*
dialect
,
*
next
;
next
=
strchr
(
lang
,
':'
);
if
(
next
)
*
next
++=
'\0'
;
int
ret
=
0
;
dialect
=
strchr
(
lang
,
'@'
);
if
(
dialect
)
*
dialect
++=
'\0'
;
charset
=
strchr
(
lang
,
'.'
);
if
(
charset
)
*
charset
++=
'\0'
;
buf
=
getenv
(
"LANGUAGE"
);
country
=
strchr
(
lang
,
'_'
);
if
(
country
)
*
country
++=
'\0'
;
if
(
!
buf
)
buf
=
getenv
(
"LANG"
);
if
(
!
buf
)
buf
=
getenv
(
"LC_ALL"
);
ret
=
MAIN_GetLanguageID
(
lang
,
country
,
charset
,
dialect
);
if
(
!
buf
)
buf
=
getenv
(
"LC_MESSAGES"
);
if
(
!
buf
)
return
userLCID
=
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
);
lang
=
next
;
if
(
!
strcmp
(
buf
,
"POSIX"
)
||
!
strcmp
(
buf
,
"C"
))
{
}
while
(
lang
&&
!
ret
);
return
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
);
}
free
(
buf
);
return
(
LANGID
)
ret
;
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*/
...
@@ -496,6 +503,10 @@ LANG_BEGIN (LANG_FINNISH, SUBLANG_DEFAULT) /*0x040B*/
#include "nls/fin.nls"
#include "nls/fin.nls"
LANG_END
LANG_END
LANG_BEGIN
(
LANG_FRENCH
,
SUBLANG_DEFAULT
)
/*0x040C*/
#include "nls/fra.nls"
LANG_END
LANG_BEGIN
(
LANG_ITALIAN
,
SUBLANG_ITALIAN
)
/*0x410*/
LANG_BEGIN
(
LANG_ITALIAN
,
SUBLANG_ITALIAN
)
/*0x410*/
#include "nls/ita.nls"
#include "nls/ita.nls"
LANG_END
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