pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

virtualbox: Fix iconv_open(3) usage on NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sat Jul 9 17:03:34 2016 +0200
Changeset:	9fa7c930015bd47479e65ef849448163bea16811

Modified Files:
	virtualbox/distinfo
Added Files:
	virtualbox/patches/patch-src_VBox_Runtime_r3_posix_utf8-posix.cpp

Log Message:
virtualbox: Fix iconv_open(3) usage on NetBSD

NetBSD's version doesn't allow empty strings as function parameters.
Behavior for this is implementation defined in POSIX.

http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv_open.html

Do what Solaris does and generate string with current locale.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9fa7c930015bd47479e65ef849448163bea16811

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 virtualbox/distinfo                                    |  1 +
 .../patch-src_VBox_Runtime_r3_posix_utf8-posix.cpp     | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diffs:
diff --git a/virtualbox/distinfo b/virtualbox/distinfo
index 9c546c8..534d753 100644
--- a/virtualbox/distinfo
+++ b/virtualbox/distinfo
@@ -190,6 +190,7 @@ SHA1 (patch-src_VBox_Runtime_r3_posix_path2-posix.cpp) = 512e64a1ae953748f589e95
 SHA1 (patch-src_VBox_Runtime_r3_posix_semevent-posix.cpp) = a14adc94fc580c1b46bd0c090f97d97b0aed1996
 SHA1 (patch-src_VBox_Runtime_r3_posix_thread-posix.cpp) = c6e672e0a394cd013e71341689c680c4bff81d38
 SHA1 (patch-src_VBox_Runtime_r3_posix_thread2-posix.cpp) = cab9219ea9a423713c0a1e4381955bd9c78615d1
+SHA1 (patch-src_VBox_Runtime_r3_posix_utf8-posix.cpp) = fe28a89beddc6e6c1ddcc2df2b7ddd893b370af2
 SHA1 (patch-src_VBox_Storage_testcase_Makefile.kmk) = edafb43c93359d0b37fbe4bec839370f2d2db29e
 SHA1 (patch-src_VBox_VMM_VMMR0_GMMR0.cpp) = 08336e3aa159e2d2092cacbd16c2011963fe3908
 SHA1 (patch-src_VBox_VMM_VMMR0_VMMR0.cpp) = 57f17e39057edea79be1fa16a43f0624eaf2a15b
diff --git a/virtualbox/patches/patch-src_VBox_Runtime_r3_posix_utf8-posix.cpp b/virtualbox/patches/patch-src_VBox_Runtime_r3_posix_utf8-posix.cpp
new file mode 100644
index 0000000..b4396b3
--- /dev/null
+++ b/virtualbox/patches/patch-src_VBox_Runtime_r3_posix_utf8-posix.cpp
@@ -0,0 +1,18 @@
+$NetBSD$
+
+--- src/VBox/Runtime/r3/posix/utf8-posix.cpp.orig	2016-03-04 19:30:04.000000000 +0000
++++ src/VBox/Runtime/r3/posix/utf8-posix.cpp
+@@ -173,7 +173,7 @@ static int rtstrConvertCached(const void
+         iconv_t hIconv = (iconv_t)*phIconv;
+         if (hIconv == (iconv_t)-1)
+         {
+-#ifdef RT_OS_SOLARIS
++#if defined(RT_OS_SOLARIS) || defined(RT_OS_NETBSD)
+             /* Solaris doesn't grok empty codeset strings, so help it find the current codeset. */
+             if (!*pszInputCS)
+                 pszInputCS = rtStrGetLocaleCodeset();
+@@ -494,4 +494,3 @@ RTR3DECL(int)  RTStrCurrentCPToUtf8Tag(c
+     }
+     return rtStrConvertWrapper(pszString, cch, "", ppszString, 0, "UTF-8", 2, RTSTRICONV_LOCALE_TO_UTF8);
+ }
+-


Home | Main Index | Thread Index | Old Index