Re: xedit Segfaults without "tags" file

Niclas Zeising <[email protected]>
Newsgroups gmane.os.freebsd.devel.x11
Message-ID <[email protected]>
On 2019-09-10 21:40, Christian Barthel wrote:
> Hello,
> 
> I am using xedit(1) on FreeBSD 12 (installed as package).
> 
> xedit-1.2.2                    Simple text editor for X
> 
> When starting xedit(1), a Segmentation Fault occurs.  It looks
> like it wants to access the file ~/tags.  After creating this
> file, xedit(1) starts as expected.
> 

Hi!
Can you try the attached patch?  It's against the ports tree, and then 
you need to rebuild the port manually or use poudriere to test it.
Thanks!
Regards
-- 
Niclas Zeising

_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-x11
To unsubscribe, send any mail to "[email protected]"
ports.x11.xedit.segfault.diff (text/x-patch, 1.6 KB)
Index: x11/xedit/Makefile
===================================================================
--- x11/xedit/Makefile	(revision 511829)
+++ x11/xedit/Makefile	(working copy)
@@ -2,12 +2,18 @@
 
 PORTNAME=	xedit
 PORTVERSION=	1.2.2
+PORTREVISION=	1
 CATEGORIES=	x11
 
 MAINTAINER=	[email protected]
 COMMENT=	Simple text editor for X
 
-XORG_CAT=	app
-USE_XORG=	xt xaw7
+LICENSE=	MIT BSD3CLAUSE
+LICENSE_COMB=	multi
+LICENSE_FILE=	${WRKSRC}/COPYING
 
+USES=		xorg-cat:app xorg
+
+USE_XORG=	x11 xmu xt xaw7
+
 .include <bsd.port.mk>
Index: x11/xedit/files/patch-util.c
===================================================================
--- x11/xedit/files/patch-util.c	(nonexistent)
+++ x11/xedit/files/patch-util.c	(working copy)
@@ -0,0 +1,27 @@
+--- util.c.orig	2015-02-21 21:42:33 UTC
++++ util.c
+@@ -506,13 +506,14 @@ ResolveName(char *filename)
+ 
+     if (result == NULL && errno == ENOENT) {
+ 	int	length;
+-	char	*dir, *file;
++	char	*dir, *file, *fname;
+ 
+ 	length = strlen(filename);
+ 	tmp = dir = XtMalloc(length + 1);
+ 	strcpy(dir, filename);
++	fname = strdup(filename);
+ 
+-	file = basename(filename);
++	file = basename(fname);
+ 	dir = dirname(tmp);
+ 
+ 	/* Creating a new file? */
+@@ -526,6 +527,7 @@ ResolveName(char *filename)
+ 	}
+ 
+ 	XtFree(tmp);
++	free(fname);
+     }
+ 
+     return (result);

Property changes on: x11/xedit/files/patch-util.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.