diff options
author | Greg Munn <greg@sgmunn.com> | 2015-12-03 22:59:25 +0300 |
---|---|---|
committer | Greg Munn <greg@sgmunn.com> | 2015-12-03 22:59:25 +0300 |
commit | 533790397a7edb6773544ee44097bf07885e88be (patch) | |
tree | 3743c003ce8a8ada007ced309b3dba56e45aa5e6 /main | |
parent | e70d1db71a75b19af2e1b0fc285c4eb7a098ceec (diff) | |
parent | f76c44b8440878372b50e3e6216cc7fec10139cb (diff) |
Merge pull request #1148 from mono/cycle6-icon-corruption
[Mac] Set LC_NUMERIC=C to workaround corruption in ElCap.
Diffstat (limited to 'main')
-rw-r--r-- | main/build/MacOSX/monostub-test.m | 5 | ||||
-rw-r--r-- | main/build/MacOSX/monostub-utils.h | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/main/build/MacOSX/monostub-test.m b/main/build/MacOSX/monostub-test.m index f30b894932..afae4b2f76 100644 --- a/main/build/MacOSX/monostub-test.m +++ b/main/build/MacOSX/monostub-test.m @@ -154,7 +154,6 @@ void check_path_has_components(char *path, const char **components, int count) { char *token, *tofree, *copy; - for (int i = 0; i < count; ++i) { BOOL found = FALSE; tofree = copy = strdup(path); @@ -195,6 +194,9 @@ void test_update_environment(void) const char *gac_components[] = { "./Resources", }; + const char *numeric_components[] = { + "C", + }; // Check that we only get updates one time, that's how monostub works. check_bool_equal(TRUE, update_environment(".")); @@ -205,6 +207,7 @@ void test_update_environment(void) check_path_has_components(getenv("PATH"), path_components, sizeof(path_components) / sizeof(char *)); check_path_has_components(getenv("PKG_CONFIG_PATH"), pkg_components, sizeof(pkg_components) / sizeof(char *)); check_path_has_components(getenv("MONO_GAC_PREFIX"), gac_components, sizeof(gac_components) / sizeof(char *)); + check_path_has_components(getenv("LC_NUMERIC"), numeric_components, sizeof(numeric_components) / sizeof(char *)); } void (*tests[])(void) = { diff --git a/main/build/MacOSX/monostub-utils.h b/main/build/MacOSX/monostub-utils.h index 4c11f158f9..5fa69c7e34 100644 --- a/main/build/MacOSX/monostub-utils.h +++ b/main/build/MacOSX/monostub-utils.h @@ -156,6 +156,18 @@ done: } static bool +replace_env (const char *variable, const char *value) +{ + const char *old = getenv (variable); + + if (old && !strcmp (old, value)) + return false; + + setenv (variable, value, true); + return true; +} + +static bool update_environment (const char *contentsDir) { bool updated = NO; @@ -209,6 +221,9 @@ update_environment (const char *contentsDir) if (push_env ("PATH", "/Library/Frameworks/Mono.framework/Commands")) updated = YES; + if (replace_env ("LC_NUMERIC", "C")) + updated = YES; + return updated; } |