Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • AppImage
  • WorkSpace
  • cmake
  • evdev
  • exclamation-mark-completion
  • gb.chart2
  • gb.git
  • gb.joystick
  • gb.net.imap
  • gb.spreadsheet
  • gb.test
  • gb.test.tap
  • master
  • newdialogs
  • stable
  • 3.11.0
  • 3.11.1
  • 3.11.2
  • 3.11.3
  • 3.11.4
  • 3.12.0
  • 3.12.1
  • 3.12.2
  • 3.13.0
  • 3.14.0
  • 3.14.1
  • 3.14.2
  • 3.14.3
  • 3.15.0
  • 3.15.1
  • 3.15.2
  • 3.16.0
  • 3.16.1
  • 3.16.2
  • 3.16.3
  • 3.17.0
  • 3.17.1
  • 3.17.2
  • 3.17.3
  • 3.18.0
  • 3.18.1
  • 3.18.2
  • 3.18.3
  • 3.18.4
  • 3.19.0
  • 3.19.1
  • 3.19.2
  • 3.19.3
  • 3.19.4
  • 3.19.5
  • 3.19.6
  • 3.20.0
  • 3.20.1
  • 3.20.2
  • 3.20.3
  • help
  • v1.9.44
  • v1.9.45
  • v1.9.46
  • v1.9.47
  • v1.9.48
  • v1.9.49
  • v1.9.50
  • v1.9.51
  • v1.9.90
  • v1.9.91
  • v1.9.92
  • v2.0.0
  • v2.1
  • v2.1.1
  • v2.10
  • v2.10.1
  • v2.10.2
  • v2.11
  • v2.11.1
  • v2.12
  • v2.13
  • v2.13.1
  • v2.14
  • v2.15
  • v2.15.1
  • v2.15.2
  • v2.16.0
  • v2.17.0
  • v2.18.0
  • v2.19.0
  • v2.2
  • v2.2.1
  • v2.20.0
  • v2.20.1
  • v2.20.2
  • v2.21.0
  • v2.22.0
  • v2.23.0
  • v2.23.1
  • v2.24.0
  • v2.3
  • v2.4
  • v2.4.1
  • v2.5
  • v2.6
  • v2.7
  • v2.8
  • v2.8.1
  • v2.8.2
  • v2.9
  • v2.9.0
  • v2.99.1
  • v2.99.2
  • v2.99.3
  • v2.99.4
  • v2.99.5
  • v2.99.6
  • v2.99.7
  • v3.0.0
115 results

Target

Select target project
  • xmonader/gambas
  • gambas/gambas
  • gbWilly/gambas
  • dtardon/gambas
  • Davidmue/gambas
  • mmu_man/gambas
  • jguardon/gambas
  • tstueker/gambas
  • timsoft/gambas
  • yann64/gambas
  • Matthew-Collins/gambas
  • microhobby/gambas
  • ercoupeflyer/gambas
  • pebauer68/gambas
  • ptmarstech/gambas
  • christhal/gambas
  • tboege/gambas
  • christopherwoo/gambas
  • yusronarif/gambas
  • gen.braga/gambas
  • MelvinG24/gambas
  • Krischel/gambas
  • liang-wei/gambas
  • brucebruen/gambas
  • LibreDWG/gambas
  • SkyN9ne/gambas
  • zxMarce/gambas
  • lordheavy/gambas
  • ddabrahams76/gambas
  • GianluigiOr/gambas
  • rfc1394/gambas
  • wekan/gambas
  • bsteers4/gambas
  • fweimer-rh/gambas
  • CDCDCDCDCDCD/gambas
  • geekdu42/gambas
  • belmotek/gambas
  • jfrank1500/gambas
  • mfischerq/gambas
  • shiny0110/gambas
  • kk667788/gambas
  • bandali/gambas
  • 64sys/gambas
  • justlostintime/gambas
  • aleasto/gambas
  • bgermann/gambas
  • linusky/gambas
47 results
Select Git revision
Show changes
Commits on Source (2)
  • gambas's avatar
    Allocate custom language environment variables statically, because environment... · 3cd80f11
    gambas authored
    Allocate custom language environment variables statically, because environment is accessed by shared library exit routines, after the interpreter memory allocations have been freed.
    
    [INTERPRETER]
    * BUG: Allocate custom language environment variables statically, because environment is accessed by shared library exit routines, after the interpreter memory allocations have been freed.
    3cd80f11
  • gambas's avatar
    Define a new limit constant, that is the maximum length of the System.Language... · 7c808bbb
    gambas authored
    Define a new limit constant, that is the maximum length of the System.Language variable. It is 16 bytes.
    
    [INTERPRETER]
    * NEW: Define a new limit constant, that is the maximum length of the System.Language variable. It is 16 bytes.
    7c808bbb
......@@ -111,9 +111,9 @@ static bool _translation_loaded = FALSE;
static LOCAL_INFO *local_current;
static char *env_LC_ALL = NULL;
static char *env_LANGUAGE = NULL;
static char *env_LANG = NULL;
static char env_LC_ALL[MAX_LANG + sizeof "LC_ALL" + 1];
static char env_LANGUAGE[MAX_LANG + sizeof "LANGUAGE" + 1];
static char env_LANG[MAX_LANG + sizeof "LANG" + 1];
static bool _currency;
......@@ -153,25 +153,10 @@ static bool is_currency_space(bool negative, bool intl)
return test_currency_flag(negative, TRUE, FALSE, intl);
}
static int my_setenv(const char *name, const char *value, char **ptr)
static void my_setenv(const char *name, const char *value, char *ptr)
{
char *str = NULL;
str = STRING_add(str, name, 0);
str = STRING_add_char(str, '=');
str = STRING_add(str, value, 0);
if (putenv(str))
{
STRING_free(&str);
return 1;
}
else
{
STRING_free(ptr);
*ptr = str;
return 0;
}
snprintf(ptr, MAX_LANG + strlen(name) + 1, "%s=%s", name, value);
putenv(ptr);
}
static void begin(void)
......@@ -605,24 +590,12 @@ void LOCAL_init(void)
}
void LOCAL_exit(void)
{
if (env_LANG)
{
if (environ == _environ)
unsetenv("LANG");
STRING_free(&env_LANG);
}
if (env_LC_ALL)
{
if (environ == _environ)
unsetenv("LANG");
unsetenv("LC_ALL");
STRING_free(&env_LC_ALL);
}
if (env_LANGUAGE)
{
if (environ == _environ)
unsetenv("LANGUAGE");
STRING_free(&env_LANGUAGE);
}
if (!LOCAL_is_UTF8)
......@@ -657,21 +630,24 @@ void LOCAL_set_lang(const char *lang)
char *var;
char *err;
if (lang && (strlen(lang) > MAX_LANG))
THROW(E_ARG);
#ifdef DEBUG_LANG
fprintf(stderr, "******** LOCAL_set_lang: %s ********\n", lang);
#endif
if (lang && *lang)
{
my_setenv("LANG", lang, &env_LANG);
my_setenv("LC_ALL", lang, &env_LC_ALL);
my_setenv("LANG", lang, env_LANG);
my_setenv("LC_ALL", lang, env_LC_ALL);
}
STRING_free(&_lang);
lang = LOCAL_get_lang();
if (getenv("LANGUAGE"))
my_setenv("LANGUAGE", lang, &env_LANGUAGE);
my_setenv("LANGUAGE", lang, env_LANGUAGE);
if (setlocale(LC_ALL, ""))
{
......
......@@ -99,5 +99,8 @@
/* Maximum number of digits in a Float */
#define MAX_FLOAT_DIGIT 15
/* Maximum length of the System.Language property */
#define MAX_LANG 16
#endif