Bug 88253

Summary: [update] devel/mime: unbreak compiling on FreeBSD >= 6.0
Product: Ports & Packages Reporter: Boris B.Samorodov <bsam>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Boris B.Samorodov 2005-10-30 21:30:04 UTC
	The port devel/mime does not compile on FreeBSD >= 6.0:
	http://pointyhat.freebsd.org/errorlogs/amd64-errorlogs/e.7.2005100423/mime-1.1_1.log

Fix: The memmem port's vatiable conflicts with one form the system.
	The port's one is changed to memmemory.

	The patch should be applied to /usr/ports/devel:
	# cd /usr/ports/devel
	# patch -p0 < the_patch
	<delete *.orig files from devel/mime, devel/mime/files>




WBR
-- 
bsam--FPghgTCESYUTLJI6uai9qtTTMlBweBBXYQqMVHfcMgD2F2sq
Content-Type: text/plain; name="devel-mime.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="devel-mime.patch"

diff -ruN mime.orig/Makefile mime/Makefile
--- mime.orig/Makefile	Fri Feb 11 12:18:32 2005
+++ mime/Makefile	Sun Oct 30 23:45:34 2005
@@ -7,7 +7,7 @@
 
 PORTNAME=	mime
 PORTVERSION=	1.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel
 MASTER_SITES=	http://resnet.uoregon.edu/~gurney_j/jmpc/dist/
 
diff -ruN /dev/null mime/files/patch-header.c
--- /dev/null	Thu Jan  1 03:00:00 1970
+++ mime/files/patch-header.c	Sun Oct 30 23:41:30 2005
@@ -0,0 +1,20 @@
+--- header.c.orig	Sun Oct 30 23:37:49 2005
++++ header.c	Sun Oct 30 23:38:13 2005
+@@ -67,7 +67,7 @@
+ 	alc = 0;
+ 
+ 	while (value < end) {
+-		crlf = memmem(value, end - value, crlfpair, strlen(crlfpair));
++		crlf = memmemory(value, end - value, crlfpair, strlen(crlfpair));
+ 		if (crlf == NULL)
+ 			goto fv_error;
+ 
+@@ -123,7 +123,7 @@
+ 		 * header line
+ 		 */
+ 		colon = memchr(header, ':', end - header);
+-		crlf = memmem(header, end - header, crlfpair, strlen(crlfpair));
++		crlf = memmemory(header, end - header, crlfpair, strlen(crlfpair));
+ 
+ 		if (colon == NULL || crlf == NULL || colon > crlf)
+ 			goto mph_error;
diff -ruN mime.orig/files/patch-message.c mime/files/patch-message.c
--- mime.orig/files/patch-message.c	Sun Jun 13 00:24:01 2004
+++ mime/files/patch-message.c	Sun Oct 30 23:40:49 2005
@@ -1,5 +1,25 @@
---- message.c.orig	Sat Jun 12 22:24:35 2004
-+++ message.c	Sat Jun 12 22:24:52 2004
+--- message.c.orig	Tue Sep 16 03:37:19 2003
++++ message.c	Sun Oct 30 23:38:44 2005
+@@ -89,7 +89,7 @@
+ 		 * XXX - need to be fixed to support "\r\n"
+ 		 */
+ 		bdcm = bd_makenorm(bd, crlfpair);
+-		bdlc = memmem(pos, len - (pos - msg), bdcm, strlen(bdcm));
++		bdlc = memmemory(pos, len - (pos - msg), bdcm, strlen(bdcm));
+ 		free(bdcm);
+ 
+ 		if (bdlc != pos) {
+@@ -146,8 +146,8 @@
+ 	for (;;) {
+ 		ret = realloc(ret, sizeof *ret * *cnt + 1);
+ 
+-		if ((next = memmem(msg, len, bdnorm, bdnormlen)) == NULL)
+-			next = memmem(msg, len, bdtail, bdtaillen);
++		if ((next = memmemory(msg, len, bdnorm, bdnormlen)) == NULL)
++			next = memmemory(msg, len, bdtail, bdtaillen);
+ 
+ 		ret[(*cnt)++] = mime_readmessage(msg, next - msg, crlfpair);
+ 
 @@ -272,6 +272,7 @@
  				eqcnt++;
  				break;
diff -ruN /dev/null mime/files/patch-util.c
--- /dev/null	Thu Jan  1 03:00:00 1970
+++ mime/files/patch-util.c	Sun Oct 30 23:41:55 2005
@@ -0,0 +1,20 @@
+--- util.c.orig	Sun Oct 30 23:38:55 2005
++++ util.c	Sun Oct 30 23:39:26 2005
+@@ -31,7 +31,7 @@
+ 
+ #if 0
+ char *
+-memmem(const char *big, int blen, const char *lit, int llen)
++memmemory(const char *big, int blen, const char *lit, int llen)
+ {
+ 	const char *pos;
+ 
+@@ -61,7 +61,7 @@
+ }
+ 
+ const char *
+-memmem(const char *T, size_t n, const char *P, size_t m)
++memmemory(const char *T, size_t n, const char *P, size_t m)
+ {
+ 	static unsigned int q = 4294967291u;
+ 	static unsigned int d = 256;
diff -ruN /dev/null mime/files/patch-util.h
--- /dev/null	Thu Jan  1 03:00:00 1970
+++ mime/files/patch-util.h	Sun Oct 30 23:42:21 2005
@@ -0,0 +1,10 @@
+--- util.h.orig	Sun Oct 30 23:39:40 2005
++++ util.h	Sun Oct 30 23:39:56 2005
+@@ -30,6 +30,6 @@
+ #ifndef _UTIL_H_
+ #define _UTIL_H_
+ 
+-char *memmem(const char *, int, const char *, int);
++char *memmemory(const char *, int, const char *, int);
+ 
+ #endif
Comment 1 Marcus Alves Grando freebsd_committer 2005-10-31 00:47:47 UTC
State Changed
From-To: open->closed

Committed. Thanks!