summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2013-08-23 02:04:36 +0800
committerLAN-TW <lantw44@gmail.com>2013-08-23 02:04:36 +0800
commit2fce676ebb79255c714a0a7b0912feb2d518a985 (patch)
tree614aedfc74423f8c1330f7c836740807e518e8f5
parent3aa1f9f2dedde705c7092633c431e7998db2cd25 (diff)
downloadgsoc2013-libgnome-autoar-2fce676ebb79255c714a0a7b0912feb2d518a985.tar
gsoc2013-libgnome-autoar-2fce676ebb79255c714a0a7b0912feb2d518a985.tar.gz
gsoc2013-libgnome-autoar-2fce676ebb79255c714a0a7b0912feb2d518a985.tar.bz2
gsoc2013-libgnome-autoar-2fce676ebb79255c714a0a7b0912feb2d518a985.tar.lz
gsoc2013-libgnome-autoar-2fce676ebb79255c714a0a7b0912feb2d518a985.tar.xz
gsoc2013-libgnome-autoar-2fce676ebb79255c714a0a7b0912feb2d518a985.tar.zst
gsoc2013-libgnome-autoar-2fce676ebb79255c714a0a7b0912feb2d518a985.zip
Set locale from environment variables beforce doing anything
libarchive may not work if the locale is not set.
-rw-r--r--tests/test-create.c3
-rw-r--r--tests/test-extract.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-create.c b/tests/test-create.c
index 391f15e..6364ef7 100644
--- a/tests/test-create.c
+++ b/tests/test-create.c
@@ -2,6 +2,7 @@
#include <gnome-autoar/autoar.h>
#include <glib.h>
+#include <locale.h>
#include <stdlib.h>
static void
@@ -55,6 +56,8 @@ main (int argc,
return 255;
}
+ setlocale (LC_ALL, "");
+
arpref = autoar_pref_new ();
autoar_pref_set_default_format (arpref, atoi (argv[1]));
autoar_pref_set_default_filter (arpref, atoi (argv[2]));
diff --git a/tests/test-extract.c b/tests/test-extract.c
index 1165f91..64876d8 100644
--- a/tests/test-extract.c
+++ b/tests/test-extract.c
@@ -2,6 +2,7 @@
#include <gnome-autoar/autoar.h>
#include <gio/gio.h>
+#include <locale.h>
#include <stdlib.h>
static void
@@ -66,6 +67,8 @@ main (int argc,
return 255;
}
+ setlocale (LC_ALL, "");
+
content = NULL;
settings = g_settings_new (AUTOAR_PREF_DEFAULT_GSCHEMA_ID);