]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blobdiff - patches/patch-af
Changes for NetBSD/i386
[pkgsrc-ghc.git] / patches / patch-af
diff --git a/patches/patch-af b/patches/patch-af
new file mode 100644 (file)
index 0000000..9bddce2
--- /dev/null
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- libraries/base/cbits/PrelIOUtils.c.orig    2009-12-11 03:23:43.000000000 +0900
++++ libraries/base/cbits/PrelIOUtils.c
+@@ -27,9 +27,18 @@ void debugBelch2(const char*s, char *t)
+ // Use a C wrapper for this because we avoid hsc2hs in base
+ #if HAVE_LANGINFO_H
+ #include <langinfo.h>
++#include <string.h>
+ char *localeEncoding (void)
+ {
+-    return nl_langinfo(CODESET);
++    char* ret = nl_langinfo(CODESET);
++
++    if (strcmp(ret, "646") == 0) {
++      /* Workaround for NetBSD/OpenBSD nl_langinfo() returning "646" for ascii. */
++        return (char*)"ASCII";
++    }
++    else {
++        return ret;
++    }
+ }
+ #endif