summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--recipes/libmms.recipe1
-rw-r--r--recipes/libmms/0002-uri-Add-implementation-of-strndup-for-platforms-that.patch44
2 files changed, 45 insertions, 0 deletions
diff --git a/recipes/libmms.recipe b/recipes/libmms.recipe
index 6136babd..5ee4885b 100644
--- a/recipes/libmms.recipe
+++ b/recipes/libmms.recipe
@@ -7,6 +7,7 @@ class Recipe(recipe.Recipe):
url = 'http://sourceforge.net/projects/libmms/files/libmms/0.6.4/libmms-0.6.4.tar.gz'
licenses = [License.LGPLv2_1Plus]
patches = ['libmms/0001-Use-native-iconv-in-windows.patch',
+ 'libmms/0002-uri-Add-implementation-of-strndup-for-platforms-that.patch',
'libmms/0005-Fix-build-on-OSX-leopard.patch']
autoreconf = True
files_libs = ['libmms']
diff --git a/recipes/libmms/0002-uri-Add-implementation-of-strndup-for-platforms-that.patch b/recipes/libmms/0002-uri-Add-implementation-of-strndup-for-platforms-that.patch
new file mode 100644
index 00000000..79cc1a66
--- /dev/null
+++ b/recipes/libmms/0002-uri-Add-implementation-of-strndup-for-platforms-that.patch
@@ -0,0 +1,44 @@
+From a5857c5a7e5f24b520d2aa98a9deb770835e1f98 Mon Sep 17 00:00:00 2001
+From: Edward Hervey <edward@centricular.com>
+Date: Mon, 18 May 2015 11:49:09 +0200
+Subject: [PATCH] uri: Add implementation of strndup for platforms that do not
+ have it
+
+Like mingw
+---
+ src/uri.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/src/uri.c b/src/uri.c
+index a96b900..ff823eb 100644
+--- a/src/uri.c
++++ b/src/uri.c
+@@ -26,6 +26,25 @@
+ #define TRUE 1
+ #endif
+
++#ifndef strdup
++/**
++ * return a malloc'd copy of at most the specified
++ * number of bytes of a string
++ * @author glibc-Team
++ */
++char *strndup (const char *s, size_t n)
++{
++ size_t len = strnlen (s, n);
++ char *new = (char *) malloc (len + 1);
++
++ if (new == NULL)
++ return NULL;
++
++ new[len] = '\0';
++ return (char *) memcpy (new, s, len);
++}
++#endif
++
+ #define g_strdup strdup
+ #define g_strndup strndup
+ #define g_malloc malloc
+--
+2.1.0
+