Merge lp:~aber/widelands/0x0000000000000000 into lp:widelands

Proposed by David Allwicher
Status: Merged
Merged at revision: 5867
Proposed branch: lp:~aber/widelands/0x0000000000000000
Merge into: lp:widelands
Diff against target: 32 lines (+12/-5)
1 file modified
src/i18n.cc (+12/-5)
To merge this branch: bzr merge lp:~aber/widelands/0x0000000000000000
Reviewer Review Type Date Requested Status
Tino Approve
Review via email: mp+50681@code.launchpad.net

Description of the change

I don't know if this code is semantically equivalent, but we need to make sure we don't access 0x0000000000000000.
So, i'm still not able to make a new widelands package. :'(
The problem is, if you start from the console, the console is your parent process and you have a different environment. So I did not notice this at first.

To post a comment you must log in.
Revision history for this message
Tino (tino79) wrote :

Applied and checked on windows.
Compiles fine.
Packaged&installed Widelands still shows all languages and detects system language correctly.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/i18n.cc'
--- src/i18n.cc 2011-02-16 18:51:00 +0000
+++ src/i18n.cc 2011-02-22 18:52:38 +0000
@@ -116,16 +116,23 @@
116 * Code inspired by wesnoth.org116 * Code inspired by wesnoth.org
117 */117 */
118void init_locale() {118void init_locale() {
119 env_locale = std::string();
119#ifdef _WIN32120#ifdef _WIN32
120 env_locale = "";
121 locale = "English";121 locale = "English";
122 SETLOCALE(LC_ALL, "English");122 SETLOCALE(LC_ALL, "English");
123#else123#else
124 // first, save environment variable124 // first, save environment variable
125 env_locale = getenv("LANG");125 char * lang;
126 if (env_locale.empty())126 lang = getenv("LANG");
127 env_locale = getenv("LANGUAGE");127 if (lang != NULL) {
128128 env_locale = lang;
129 }
130 if (env_locale.empty()) {
131 lang = getenv("LANGUAGE");
132 if (lang != NULL) {
133 env_locale = lang;
134 }
135 }
129 locale = "C";136 locale = "C";
130 SETLOCALE(LC_ALL, "C");137 SETLOCALE(LC_ALL, "C");
131 SETLOCALE(LC_MESSAGES, "");138 SETLOCALE(LC_MESSAGES, "");

Subscribers

People subscribed via source and target branches

to status/vote changes: