diff options
author | wen <wen@FreeBSD.org> | 2010-10-27 09:07:27 +0800 |
---|---|---|
committer | wen <wen@FreeBSD.org> | 2010-10-27 09:07:27 +0800 |
commit | 6bd81cbe8a9f1ab2ad52860bc416d71084caebe0 (patch) | |
tree | 11cb8882ca8f5497319e761c70da6e298f2bac38 /devel | |
parent | 665fdee3dd5e7dac2cb2256900177f5afc5d75e6 (diff) | |
download | freebsd-ports-gnome-6bd81cbe8a9f1ab2ad52860bc416d71084caebe0.tar.gz freebsd-ports-gnome-6bd81cbe8a9f1ab2ad52860bc416d71084caebe0.tar.zst freebsd-ports-gnome-6bd81cbe8a9f1ab2ad52860bc416d71084caebe0.zip |
- Fix build for OSVERSION < 702000
PR: ports/151762
Submitted by: "Pawel Pekala" <c0rn@o2.pl> (maintainer)
Diffstat (limited to 'devel')
-rw-r--r-- | devel/upnp/Makefile | 10 | ||||
-rw-r--r-- | devel/upnp/files/extra-upnp-src-api-UpnpString.c | 14 |
2 files changed, 23 insertions, 1 deletions
diff --git a/devel/upnp/Makefile b/devel/upnp/Makefile index 46d9ca01de84..5fb745763a77 100644 --- a/devel/upnp/Makefile +++ b/devel/upnp/Makefile @@ -7,6 +7,7 @@ PORTNAME= upnp PORTVERSION= 1.6.8 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= devel MASTER_SITES= SF/p${PORTNAME}/p${PORTNAME}/libUPnP%20${PORTVERSION} @@ -38,4 +39,11 @@ post-patch: .SILENT ${REINPLACE_CMD} '/^pkgconfigexecdir/s|$$(libdir)|$$(prefix)/libdata|' \ ${WRKSRC}/Makefile.in -.include <bsd.port.mk> +.include <bsd.port.pre.mk> + +# strndup(3) was added in 7.2-RELEASE +.if ${OSVERSION} < 702000 +EXTRA_PATCHES+= ${FILESDIR}/extra-upnp-src-api-UpnpString.c +.endif + +.include <bsd.port.post.mk> diff --git a/devel/upnp/files/extra-upnp-src-api-UpnpString.c b/devel/upnp/files/extra-upnp-src-api-UpnpString.c new file mode 100644 index 000000000000..94c2b2265d29 --- /dev/null +++ b/devel/upnp/files/extra-upnp-src-api-UpnpString.c @@ -0,0 +1,14 @@ +--- upnp/src/api/UpnpString.c.orig 2010-10-26 21:46:15.000000000 +0200 ++++ upnp/src/api/UpnpString.c 2010-10-26 21:51:47.000000000 +0200 +@@ -165,8 +165,10 @@ + + int UpnpString_set_StringN(UpnpString *p, const char *s, size_t n) + { +- char *q = strndup(s, n); ++ char *q = malloc(n+1); + if (!q) goto error_handler1; ++ strncpy(q, s, n); ++ q[n-1] = '\0'; + free(((struct SUpnpString *)p)->m_string); + ((struct SUpnpString *)p)->m_length = strlen(q); + ((struct SUpnpString *)p)->m_string = q; |