[Pkg-haskell-commits] darcs: haskell-unix-time: Pass a valid locale name to newlocale, fixing a test failure on non-Linux architectures.

Colin Watson cjwatson at debian.org
Sat Jun 15 01:53:20 UTC 2013


Sat Jun 15 01:52:46 UTC 2013  Colin Watson <cjwatson at debian.org>
  * Pass a valid locale name to newlocale, fixing a test failure on non-Linux architectures.

    M ./changelog +2
    A ./patches/pass-valid-locale-name-to-newlocale.patch
    M ./patches/series +1

Sat Jun 15 01:52:46 UTC 2013  Colin Watson <cjwatson at debian.org>
  * Pass a valid locale name to newlocale, fixing a test failure on non-Linux architectures.
diff -rN -u old-haskell-unix-time/changelog new-haskell-unix-time/changelog
--- old-haskell-unix-time/changelog	2013-06-15 01:53:19.641547671 +0000
+++ new-haskell-unix-time/changelog	2013-06-15 01:53:19.641547671 +0000
@@ -3,6 +3,8 @@
   * Only enable tests on architectures with GHCi, due to use of Template
     Haskell.
   * Define _GNU_SOURCE for strptime_l.
+  * Pass a valid locale name to newlocale, fixing a test failure on
+    non-Linux architectures.
 
  -- Colin Watson <cjwatson at debian.org>  Sat, 15 Jun 2013 01:40:45 +0100
 
diff -rN -u old-haskell-unix-time/patches/pass-valid-locale-name-to-newlocale.patch new-haskell-unix-time/patches/pass-valid-locale-name-to-newlocale.patch
--- old-haskell-unix-time/patches/pass-valid-locale-name-to-newlocale.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-unix-time/patches/pass-valid-locale-name-to-newlocale.patch	2013-06-15 01:53:19.649545348 +0000
@@ -0,0 +1,21 @@
+Description: Pass a valid locale name to newlocale
+ FreeBSD libc treats a NULL second argument to newlocale as equivalent to
+ "C", but glibc returns an error in that case, causing a segfault shortly
+ afterwards when passing a NULL locale to strftime_l/strptime_l.
+Author: Colin Watson <cjwatson at debian.org>
+Forwarded: https://github.com/kazu-yamamoto/unix-time/pull/11
+Last-Update: 2013-06-15
+
+Index: b/cbits/conv.c
+===================================================================
+--- a/cbits/conv.c
++++ b/cbits/conv.c
+@@ -21,7 +21,7 @@
+ locale_t c_locale = NULL;
+ 
+ void init_locale() {
+-    if (c_locale == NULL) c_locale = newlocale(LC_TIME_MASK, NULL, NULL);
++    if (c_locale == NULL) c_locale = newlocale(LC_TIME_MASK, "C", NULL);
+ }
+ #else
+ void init_locale() {
diff -rN -u old-haskell-unix-time/patches/series new-haskell-unix-time/patches/series
--- old-haskell-unix-time/patches/series	2013-06-15 01:53:19.641547671 +0000
+++ new-haskell-unix-time/patches/series	2013-06-15 01:53:19.649545348 +0000
@@ -1 +1,2 @@
 implicit-declaration.patch
+pass-valid-locale-name-to-newlocale.patch




More information about the Pkg-haskell-commits mailing list