diff options
author | Olivier Duchateau <olivierd@FreeBSD.org> | 2015-06-29 16:49:15 +0000 |
---|---|---|
committer | Olivier Duchateau <olivierd@FreeBSD.org> | 2015-06-29 16:49:15 +0000 |
commit | df975d029b1f04cbecc4da160031cb8353a9f4f5 (patch) | |
tree | 057a263522e3b49e18b426b8228ab646dc5c9a21 /editors/mg | |
parent | 22b22f1014535cb5b5f9cb3c488eabe97ca54027 (diff) |
Notes
Diffstat (limited to 'editors/mg')
-rw-r--r-- | editors/mg/Makefile | 2 | ||||
-rw-r--r-- | editors/mg/distinfo | 4 | ||||
-rw-r--r-- | editors/mg/files/patch-autoexec.c | 34 | ||||
-rw-r--r-- | editors/mg/files/patch-def.h | 11 | ||||
-rw-r--r-- | editors/mg/files/patch-display.c | 40 |
5 files changed, 88 insertions, 3 deletions
diff --git a/editors/mg/Makefile b/editors/mg/Makefile index 748fc60df11f..259ae6a34ddd 100644 --- a/editors/mg/Makefile +++ b/editors/mg/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= mg -PORTVERSION= 20140414 +PORTVERSION= 20150323 CATEGORIES= editors MASTER_SITES= http://homepage.boetes.org/software/mg/ diff --git a/editors/mg/distinfo b/editors/mg/distinfo index 51e45fe2c073..fad65764c6d6 100644 --- a/editors/mg/distinfo +++ b/editors/mg/distinfo @@ -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 diff --git a/editors/mg/files/patch-autoexec.c b/editors/mg/files/patch-autoexec.c new file mode 100644 index 000000000000..aa851258f3c9 --- /dev/null +++ b/editors/mg/files/patch-autoexec.c @@ -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; diff --git a/editors/mg/files/patch-def.h b/editors/mg/files/patch-def.h new file mode 100644 index 000000000000..cdd9c9678db9 --- /dev/null +++ b/editors/mg/files/patch-def.h @@ -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! */ diff --git a/editors/mg/files/patch-display.c b/editors/mg/files/patch-display.c new file mode 100644 index 000000000000..d73358856978 --- /dev/null +++ b/editors/mg/files/patch-display.c @@ -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 |