diff options
author | Ulrich Müller <ulm@gentoo.org> | 2013-10-22 10:34:29 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2013-10-22 10:34:29 +0000 |
commit | 7425b9b7c84131710c88a27a2f80ee3952473819 (patch) | |
tree | 2043a2d6b938122be50e8061672efa7c6e65db5c /app-editors/mg | |
parent | dev-libs/qcodeedit: New addition (diff) | |
download | gentoo-2-7425b9b7c84131710c88a27a2f80ee3952473819.tar.gz gentoo-2-7425b9b7c84131710c88a27a2f80ee3952473819.tar.bz2 gentoo-2-7425b9b7c84131710c88a27a2f80ee3952473819.zip |
Replace dirname patch by the official fix from OpenBSD.
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 9433907D693FB5B8!)
Diffstat (limited to 'app-editors/mg')
-rw-r--r-- | app-editors/mg/ChangeLog | 8 | ||||
-rw-r--r-- | app-editors/mg/files/mg-20130922-dirname.patch | 37 | ||||
-rw-r--r-- | app-editors/mg/mg-20130922-r2.ebuild (renamed from app-editors/mg/mg-20130922-r1.ebuild) | 2 |
3 files changed, 33 insertions, 14 deletions
diff --git a/app-editors/mg/ChangeLog b/app-editors/mg/ChangeLog index b9f610abbc33..94c5c9a103c1 100644 --- a/app-editors/mg/ChangeLog +++ b/app-editors/mg/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-editors/mg # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/mg/ChangeLog,v 1.62 2013/10/13 07:34:48 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/mg/ChangeLog,v 1.63 2013/10/22 10:34:28 ulm Exp $ + +*mg-20130922-r2 (22 Oct 2013) + + 22 Oct 2013; Ulrich Müller <ulm@gentoo.org> -mg-20130922-r1.ebuild, + +mg-20130922-r2.ebuild, files/mg-20130922-dirname.patch: + Replace dirname patch by the official fix from OpenBSD. *mg-20130922-r1 (13 Oct 2013) diff --git a/app-editors/mg/files/mg-20130922-dirname.patch b/app-editors/mg/files/mg-20130922-dirname.patch index 4c443eeaa921..c8b93a702fbd 100644 --- a/app-editors/mg/files/mg-20130922-dirname.patch +++ b/app-editors/mg/files/mg-20130922-dirname.patch @@ -1,39 +1,52 @@ Fix dirname(3) call in readin and writeout functions. https://bugs.gentoo.org/487758 +Patch from OpenBSD CVS: +http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mg/file.c.diff?r1=1.87;r2=1.89 + --- mg-20130922-orig/file.c +++ mg-20130922/file.c -@@ -210,7 +210,7 @@ +@@ -210,7 +210,7 @@ readin(char *fname) struct stat statbuf; int status, i, ro = FALSE; PF *ael; - char *dp; -+ char ts[NFILEN], *dp; ++ char dp[NFILEN]; /* might be old */ if (bclear(curbp) != TRUE) -@@ -255,7 +255,8 @@ +@@ -255,7 +255,8 @@ readin(char *fname) if (errno != ENOENT) ro = TRUE; else if (errno == ENOENT) { - dp = dirname(fname); -+ (void)strlcpy(ts, fname, NFILEN); -+ dp = dirname(ts); ++ (void)xdirname(dp, fname, sizeof(dp)); ++ (void)strlcat(dp, "/", sizeof(dp)); if (stat(dp, &statbuf) == -1 && errno == ENOENT) { /* no read-only; like emacs */ ewprintf("Use M-x make-directory RET RET to " -@@ -669,11 +670,11 @@ +@@ -669,19 +670,17 @@ writeout(FILE ** ffp, struct buffer *bp, char *fn) { struct stat statbuf; int s; - char *dp; -- -- dp = dirname(fn); -+ char ts[NFILEN], *dp; ++ char dp[NFILEN]; +- dp = dirname(fn); +- if (stat(fn, &statbuf) == -1 && errno == ENOENT) { -+ (void)strlcpy(ts, fn, NFILEN); -+ dp = dirname(ts); errno = 0; ++ (void)xdirname(dp, fn, sizeof(dp)); ++ (void)strlcat(dp, "/", sizeof(dp)); if (access(dp, W_OK) && errno == EACCES) { - ewprintf("Directory %s%s write-protected", dp, +- ewprintf("Directory %s%s write-protected", dp, +- (dp[0] == '/' && dp[1] == '\0') ? "" : "/"); ++ ewprintf("Directory %s write-protected", dp); + return (FIOERR); + } else if (errno == ENOENT) { +- ewprintf("%s%s: no such directory", dp, +- (dp[0] == '/' && dp[1] == '\0') ? "" : "/"); ++ ewprintf("%s: no such directory", dp); + return (FIOERR); + } + } diff --git a/app-editors/mg/mg-20130922-r1.ebuild b/app-editors/mg/mg-20130922-r2.ebuild index 2cee2c59dee9..179763bdec54 100644 --- a/app-editors/mg/mg-20130922-r1.ebuild +++ b/app-editors/mg/mg-20130922-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/mg/mg-20130922-r1.ebuild,v 1.1 2013/10/13 07:12:46 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/mg/mg-20130922-r2.ebuild,v 1.1 2013/10/22 10:34:28 ulm Exp $ EAPI=5 |