FreeBSD Bugzilla – Attachment 174698 Details for
Bug 212634
editors/mg: Update to latest snapshot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
mg.diff
mg.diff (text/plain), 9.45 KB, created by
Tobias Kortkamp
on 2016-09-12 21:58:59 UTC
(
hide
)
Description:
mg.diff
Filename:
MIME Type:
Creator:
Tobias Kortkamp
Created:
2016-09-12 21:58:59 UTC
Size:
9.45 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 421963) >+++ Makefile (working copy) >@@ -2,14 +2,15 @@ > # $FreeBSD$ > > PORTNAME= mg >-PORTVERSION= 20160421 >-PORTREVISION= 1 >+PORTVERSION= 20160912 > CATEGORIES= editors > MASTER_SITES= http://homepage.boetes.org/software/mg/ > >-MAINTAINER= darcsis@gmail.com >+MAINTAINER= t@tobik.me > COMMENT= Small, fast Emacs-like editor > >+LICENSE= PD >+ > USES= ncurses > PLIST_FILES= bin/mg man/man1/mg.1.gz > PORTDOCS= README tutorial >@@ -22,7 +23,8 @@ > BROKEN= does not build, requires futimens system call > .endif > >-pre-configure: >+post-patch: >+ ${CP} ${FILESDIR}/reallocarray.c ${WRKSRC} > @${REINPLACE_CMD} -e 's|__dead|__dead2|' ${WRKSRC}/main.c > > do-install: >Index: distinfo >=================================================================== >--- distinfo (revision 421963) >+++ distinfo (working copy) >@@ -1,2 +1,3 @@ >-SHA256 (mg-20160421.tar.gz) = b5dd8fbecb8a0ff0f32588c448f22f25fafcbfb297857e76d2883598a3e63a9a >-SIZE (mg-20160421.tar.gz) = 145187 >+TIMESTAMP = 1473715513 >+SHA256 (mg-20160912.tar.gz) = 0b050456b78d767d13839486e01705de6acf407f27052c204505e166eb698176 >+SIZE (mg-20160912.tar.gz) = 145176 >Index: files/patch-GNUmakefile >=================================================================== >--- files/patch-GNUmakefile (revision 421963) >+++ files/patch-GNUmakefile (nonexistent) >@@ -1,22 +0,0 @@ >---- GNUmakefile.orig 2016-01-18 15:01:49 UTC >-+++ GNUmakefile >-@@ -17,16 +17,10 @@ PKG_CONFIG= /usr/bin/pkg-config >- INSTALL= /usr/bin/install >- STRIP= /usr/bin/strip >- >--UNAME:= $(shell uname) >--ifeq ($(UNAME),FreeBSD) >-- BSD_CPPFLAGS:= >-- BSD_LIBS:= -lutil >--else >-- BSD_CPPFLAGS:=$(shell $(PKG_CONFIG) --cflags libbsd-overlay) >-- BSD_LIBS:= $(shell $(PKG_CONFIG) --libs libbsd-overlay) >--endif >-+BSD_CPPFLAGS:= >-+BSD_LIBS:= -lutil >- >--CURSES_LIBS= -lcurses >-+CURSES_LIBS= -lncurses >- >- CC?= gcc >- CFLAGS?= -O2 -pipe > >Property changes on: files/patch-GNUmakefile >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: files/patch-Makefile >=================================================================== >--- files/patch-Makefile (revision 421963) >+++ files/patch-Makefile (working copy) >@@ -1,4 +1,4 @@ >---- Makefile.orig 2016-01-07 18:55:54 UTC >+--- Makefile.orig 2016-09-12 16:36:25 UTC > +++ Makefile > @@ -2,7 +2,7 @@ > >@@ -9,3 +9,12 @@ > DPADD+= ${LIBCURSES} ${LIBUTIL} > > # (Common) compile-time options: >+@@ -23,6 +23,8 @@ SRCS= autoexec.c basic.c bell.c buffer.c >+ # >+ SRCS+= cmode.c cscope.c dired.c grep.c tags.c theo.c >+ >++SRCS+= reallocarray.c >++ >+ afterinstall: >+ ${INSTALL} -d -o root -g wheel ${DESTDIR}${DOCDIR}/mg >+ ${INSTALL} ${INSTALL_COPY} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \ >Index: files/patch-autoexec.c >=================================================================== >--- files/patch-autoexec.c (revision 421963) >+++ files/patch-autoexec.c (nonexistent) >@@ -1,34 +0,0 @@ >---- 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; > >Property changes on: files/patch-autoexec.c >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: files/patch-def.h >=================================================================== >--- files/patch-def.h (revision 421963) >+++ files/patch-def.h (working copy) >@@ -1,11 +1,11 @@ >---- def.h.orig 2015-03-23 11:23:30 UTC >+--- def.h.orig 2016-09-01 15:30:59 UTC > +++ def.h >-@@ -13,6 +13,8 @@ >- #include "chrdef.h" >- #include "ttydef.h" >+@@ -328,6 +328,8 @@ struct undo_rec { >+ * Prototypes. >+ */ > >-+#include <sys/types.h> >++void *reallocarray(void*, size_t, size_t); > + >- >- /* necesarry to get asprintf & friends with glibc XXX doesn't work for some >- * mysterious reason! */ >+ /* tty.c X */ >+ void ttinit(void); >+ void ttreinit(void); >Index: files/patch-display.c >=================================================================== >--- files/patch-display.c (revision 421963) >+++ files/patch-display.c (nonexistent) >@@ -1,40 +0,0 @@ >---- 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 > >Property changes on: files/patch-display.c >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: files/reallocarray.c >=================================================================== >--- files/reallocarray.c (nonexistent) >+++ files/reallocarray.c (working copy) >@@ -0,0 +1,39 @@ >+/* $OpenBSD: reallocarray.c,v 1.3 2015/09/13 08:31:47 guenther Exp $ */ >+/* >+ * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net> >+ * >+ * Permission to use, copy, modify, and distribute this software for any >+ * purpose with or without fee is hereby granted, provided that the above >+ * copyright notice and this permission notice appear in all copies. >+ * >+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES >+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF >+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR >+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES >+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN >+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF >+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. >+ */ >+ >+#include <sys/types.h> >+#include <errno.h> >+#include <stdint.h> >+#include <stdlib.h> >+ >+/* >+ * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX >+ * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW >+ */ >+#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) >+ >+void * >+reallocarray(void *optr, size_t nmemb, size_t size) >+{ >+ if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && >+ nmemb > 0 && SIZE_MAX / nmemb < size) { >+ errno = ENOMEM; >+ return NULL; >+ } >+ return realloc(optr, size * nmemb); >+} >+ > >Property changes on: files/reallocarray.c >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: pkg-descr >=================================================================== >--- pkg-descr (revision 421963) >+++ pkg-descr (working copy) >@@ -3,17 +3,4 @@ > who can't, or don't want to, run the real GNU Emacs, or are not > familiar with the vi(1) editor. > >-Although it is intended to be largely compatible with GNU Emacs, Mg >-doesn't have special modes for tasks other than editing plain text. >-Moreover, since it is written entirely in C, there is no language in >-which to write extensions in (read: no builtin Lisp interpreter). >- >-If you are looking for something that looks like Emacs (don't want to >-learn another editor) but don't have the resources to run the latter, >-this may be what you're looking for. >- >-Enjoy! >- >- Dima Dorfman >- dima@unixfreak.org >- 14 May 2001 >+WWW: http://homepage.boetes.org/software/mg/
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212634
:
174698
|
174699