From f4aad6320b745174c0c6b36596a3d38784affa35 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Sun, 13 Oct 2013 07:34:49 +0000 Subject: Fix dirname(3) call in readin and writeout functions, bug 487758. (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 9433907D693FB5B8!) --- app-editors/mg/ChangeLog | 6 +++--- app-editors/mg/files/mg-20130922-dirname.patch | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) (limited to 'app-editors/mg') diff --git a/app-editors/mg/ChangeLog b/app-editors/mg/ChangeLog index d5f9ebb33b45..b9f610abbc33 100644 --- a/app-editors/mg/ChangeLog +++ b/app-editors/mg/ChangeLog @@ -1,13 +1,13 @@ # 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.61 2013/10/13 07:12:45 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/mg/ChangeLog,v 1.62 2013/10/13 07:34:48 ulm Exp $ *mg-20130922-r1 (13 Oct 2013) 13 Oct 2013; Ulrich Müller -mg-20130922.ebuild, +mg-20130922-r1.ebuild, +files/mg-20130922-dirname.patch: - Fix dirname(3) call in writeout function, bug 487758. Thanks to Marien Zwart - . + Fix dirname(3) call in readin and writeout functions, bug 487758. Thanks to + Marien Zwart . 09 Oct 2013; Ulrich Müller mg-20130922.ebuild: Specify CPPFLAGS not CFLAGS for preprocessor options. Add missing EPREFIX. diff --git a/app-editors/mg/files/mg-20130922-dirname.patch b/app-editors/mg/files/mg-20130922-dirname.patch index c97958948bfe..4c443eeaa921 100644 --- a/app-editors/mg/files/mg-20130922-dirname.patch +++ b/app-editors/mg/files/mg-20130922-dirname.patch @@ -1,9 +1,28 @@ -Fix dirname(3) call in writeout function. +Fix dirname(3) call in readin and writeout functions. https://bugs.gentoo.org/487758 --- mg-20130922-orig/file.c +++ mg-20130922/file.c -@@ -669,11 +669,11 @@ +@@ -210,7 +210,7 @@ + struct stat statbuf; + int status, i, ro = FALSE; + PF *ael; +- char *dp; ++ char ts[NFILEN], *dp; + + /* might be old */ + if (bclear(curbp) != TRUE) +@@ -255,7 +255,8 @@ + if (errno != ENOENT) + ro = TRUE; + else if (errno == ENOENT) { +- dp = dirname(fname); ++ (void)strlcpy(ts, fname, NFILEN); ++ dp = dirname(ts); + 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 @@ { struct stat statbuf; int s; -- cgit v1.2.3-65-gdbad