mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
Merge branch 'wip/lantw/gdatetime-unset-lc-all-for-the-test-as-well' into 'master'
gdatetime: Unset LC_ALL for the test as well See merge request GNOME/glib!970
This commit is contained in:
commit
1230be3d11
@ -1327,6 +1327,7 @@ test_GDateTime_printf (void)
|
|||||||
* that long, and it will cause the test to fail if dst isn't big
|
* that long, and it will cause the test to fail if dst isn't big
|
||||||
* enough.
|
* enough.
|
||||||
*/
|
*/
|
||||||
|
gchar *old_lc_all;
|
||||||
gchar *old_lc_messages;
|
gchar *old_lc_messages;
|
||||||
gchar dst[64];
|
gchar dst[64];
|
||||||
struct tm tt;
|
struct tm tt;
|
||||||
@ -1357,6 +1358,9 @@ GDateTime *__dt = g_date_time_new_local (2009, 10, 24, 0, 0, 0);\
|
|||||||
g_date_time_unref (dt); \
|
g_date_time_unref (dt); \
|
||||||
g_free (p); } G_STMT_END
|
g_free (p); } G_STMT_END
|
||||||
|
|
||||||
|
old_lc_all = g_strdup (g_getenv ("LC_ALL"));
|
||||||
|
g_unsetenv ("LC_ALL");
|
||||||
|
|
||||||
old_lc_messages = g_strdup (g_getenv ("LC_MESSAGES"));
|
old_lc_messages = g_strdup (g_getenv ("LC_MESSAGES"));
|
||||||
g_setenv ("LC_MESSAGES", "C", TRUE);
|
g_setenv ("LC_MESSAGES", "C", TRUE);
|
||||||
|
|
||||||
@ -1434,6 +1438,10 @@ GDateTime *__dt = g_date_time_new_local (2009, 10, 24, 0, 0, 0);\
|
|||||||
else
|
else
|
||||||
g_unsetenv ("LC_MESSAGES");
|
g_unsetenv ("LC_MESSAGES");
|
||||||
g_free (old_lc_messages);
|
g_free (old_lc_messages);
|
||||||
|
|
||||||
|
if (old_lc_all != NULL)
|
||||||
|
g_setenv ("LC_ALL", old_lc_all, TRUE);
|
||||||
|
g_free (old_lc_all);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user