aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2009-01-21 04:30:05 +0000
committerDan Fandrich <dan@coneharvesters.com>2009-01-21 04:30:05 +0000
commit6bb9ef8de4273e0f5f5e499eb61a972b3644f70f (patch)
tree0bb698e8f78f8e2c4253b11e2c1887bdb34e0eb8
parent14a67885356554feafd5bb25a1097c1b2dbada00 (diff)
Call setlocale() for libtest tests to test the effects of locale-induced
libc changes on libcurl.
-rw-r--r--tests/libtest/first.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/libtest/first.c b/tests/libtest/first.c
index 9b06f74bc..032704ca0 100644
--- a/tests/libtest/first.c
+++ b/tests/libtest/first.c
@@ -10,6 +10,10 @@
#include "test.h"
+#ifdef HAVE_LOCALE_H
+#include <locale.h> /* for setlocale() */
+#endif
+
#ifdef CURLDEBUG
# define MEMDEBUG_NODEFINES
# include "memdebug.h"
@@ -60,6 +64,16 @@ int main(int argc, char **argv)
curl_free(env);
}
#endif
+
+ /*
+ * Setup proper locale from environment. This is needed to enable locale-
+ * specific behaviour by the C library in order to test for undesired side
+ * effects that could cause in libcurl.
+ */
+#ifdef HAVE_SETLOCALE
+ setlocale(LC_ALL, "");
+#endif
+
if(argc< 2 ) {
fprintf(stderr, "Pass URL as argument please\n");
return 1;