Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jun 2015 16:49:15 +0000 (UTC)
From:      Olivier Duchateau <olivierd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r390922 - in head/editors/mg: . files
Message-ID:  <201506291649.t5TGnFrt033127@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: olivierd
Date: Mon Jun 29 16:49:15 2015
New Revision: 390922
URL: https://svnweb.freebsd.org/changeset/ports/390922

Log:
  - Update to 20150323 snapshot
  - Add patches which replace reallocarray by realloc(3)
  
  PR:		200682
  Submitted by:	myself
  Approved by:	darcsis (maintainer, timeout > 3 weeks)

Added:
  head/editors/mg/files/
  head/editors/mg/files/patch-autoexec.c   (contents, props changed)
  head/editors/mg/files/patch-def.h   (contents, props changed)
  head/editors/mg/files/patch-display.c   (contents, props changed)
Modified:
  head/editors/mg/Makefile
  head/editors/mg/distinfo

Modified: head/editors/mg/Makefile
==============================================================================
--- head/editors/mg/Makefile	Mon Jun 29 16:34:18 2015	(r390921)
+++ head/editors/mg/Makefile	Mon Jun 29 16:49:15 2015	(r390922)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	mg
-PORTVERSION=	20140414
+PORTVERSION=	20150323
 CATEGORIES=	editors
 MASTER_SITES=	http://homepage.boetes.org/software/mg/
 

Modified: head/editors/mg/distinfo
==============================================================================
--- head/editors/mg/distinfo	Mon Jun 29 16:34:18 2015	(r390921)
+++ head/editors/mg/distinfo	Mon Jun 29 16:49:15 2015	(r390922)
@@ -1,2 +1,2 @@
-SHA256 (mg-20140414.tar.gz) = 89ce25ee13cedc14c3c5c7b76d7a9e0ea38a060ad61e90ac43258d8dadf0d065
-SIZE (mg-20140414.tar.gz) = 142570
+SHA256 (mg-20150323.tar.gz) = d71b24d47d3e1426f162e446d92dfa457df96dd47c1289419cba9fd14c2c3afb
+SIZE (mg-20150323.tar.gz) = 142105

Added: head/editors/mg/files/patch-autoexec.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/mg/files/patch-autoexec.c	Mon Jun 29 16:49:15 2015	(r390922)
@@ -0,0 +1,34 @@
+--- autoexec.c.orig	2015-03-23 11:03:05 UTC
++++ autoexec.c
+@@ -2,12 +2,17 @@
+ /* this file is in the public domain */
+ /* Author: Vincent Labrecque <vincent@openbsd.org>	April 2002 */
+ 
++#include <sys/param.h>
+ #include <sys/queue.h>
+ #include <fnmatch.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifndef __OpenBSD__
++#include <stdlib.h>
++#include <malloc_np.h>
++#endif
+ 
+ #include "def.h"
+ #include "funmap.h"
+@@ -44,8 +49,13 @@ find_autoexec(const char *fname)
+ 	SLIST_FOREACH(ae, &autos, next) {
+ 		if (fnmatch(ae->pattern, fname, 0) == 0) {
+ 			if (used >= have) {
++				#if defined(__OpenBSD__)
+ 				npfl = reallocarray(pfl, have + AUTO_GROW + 1,
+ 				    sizeof(PF));
++				#else
++				npfl = realloc(pfl, (have + AUTO_GROW + 1) *
++				    sizeof(PF));
++				#endif
+ 				if (npfl == NULL)
+ 					panic("out of memory");
+ 				pfl = npfl;

Added: head/editors/mg/files/patch-def.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/mg/files/patch-def.h	Mon Jun 29 16:49:15 2015	(r390922)
@@ -0,0 +1,11 @@
+--- def.h.orig	2015-03-23 11:23:30 UTC
++++ def.h
+@@ -13,6 +13,8 @@
+ #include        "chrdef.h"
+ #include        "ttydef.h"
+ 
++#include        <sys/types.h>
++
+ 
+ /* necesarry to get asprintf & friends with glibc XXX doesn't work for some
+  * mysterious reason! */

Added: head/editors/mg/files/patch-display.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/mg/files/patch-display.c	Mon Jun 29 16:49:15 2015	(r390922)
@@ -0,0 +1,40 @@
+--- display.c.orig	2015-03-16 14:39:00 UTC
++++ display.c
+@@ -170,14 +170,6 @@ vtresize(int force, int newrow, int newc
+ 		(a) = tmp;					\
+ 	} while (0)
+ 
+-#define TRYREALLOCARRAY(a, n, m) do {				\
+-		void *tmp;					\
+-		if ((tmp = reallocarray((a), (n), (m))) == NULL) {\
+-			panic("out of memory in display code");	\
+-		}						\
+-		(a) = tmp;					\
+-	} while (0)
+-
+ 	/* No update needed */
+ 	if (!first_run && !force && !rowchanged && !colchanged)
+ 		return (TRUE);
+@@ -206,10 +198,10 @@ vtresize(int force, int newrow, int newc
+ 			}
+ 		}
+ 
+-		TRYREALLOCARRAY(score, newrow, newrow * sizeof(struct score));
+-		TRYREALLOCARRAY(vscreen, (newrow - 1), sizeof(struct video *));
+-		TRYREALLOCARRAY(pscreen, (newrow - 1), sizeof(struct video *));
+-		TRYREALLOCARRAY(video, (newrow - 1), 2 * sizeof(struct video));
++		TRYREALLOC(score, newrow * newrow * sizeof(struct score));
++		TRYREALLOC(vscreen, (newrow - 1) * sizeof(struct video *));
++		TRYREALLOC(pscreen, (newrow - 1) * sizeof(struct video *));
++		TRYREALLOC(video, ((newrow - 1) * 2) * sizeof(struct video));
+ 
+ 		/*
+ 		 * Zero-out the entries we just allocated.
+@@ -247,7 +239,6 @@ vtresize(int force, int newrow, int newc
+ }
+ 
+ #undef TRYREALLOC
+-#undef TRYREALLOCARRAY
+ 
+ /*
+  * Initialize the data structures used



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506291649.t5TGnFrt033127>