summaryrefslogtreecommitdiff
path: root/community/mg/cleanup.patch
blob: d4d29c50fd58b3c824f80dbe8d8474e53be3ce6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff -wbBur mg-20130922/file.c mg-20130922.q/file.c
--- mg-20130922/file.c	2013-09-22 13:09:36.000000000 +0400
+++ mg-20130922.q/file.c	2013-10-30 15:20:47.927840374 +0400
@@ -669,9 +669,9 @@
 {
 	struct stat	statbuf;
 	int	 s;
-	char    *dp;
+	char    *dp = malloc(strlen(fn) + 1);
 
-	dp = dirname(fn);
+	xdirname(dp, fn, strlen(fn));
 
 	if (stat(fn, &statbuf) == -1 && errno == ENOENT) {
 		errno = 0;
diff -wbBur mg-20130922/Makefile mg-20130922.q/Makefile
--- mg-20130922/Makefile	2013-09-22 18:06:43.000000000 +0400
+++ mg-20130922.q/Makefile	2013-10-30 15:20:34.201173866 +0400
@@ -4,7 +4,7 @@
 NOGCCERROR= true
 PROG=	mg
 
-LDADD+=	-lcurses -lutil -lclens
+LDADD+=	-lcurses -lutil -lclens -lbsd
 DPADD+=	${LIBCURSES} ${LIBUTIL}
 
 # (Common) compile-time options:
@@ -17,7 +17,7 @@
 #
 CFLAGS  = -O2
 CFLAGS += -Wall -DFKEYS -DREGEX -DXKEYS
-CFLAGS += -I/usr/local/include/clens
+CFLAGS += -I/usr/include/clens -isystem /usr/include/bsd -DLIBBSD_OVERLAY
 
 SRCS=	autoexec.c basic.c bell.c buffer.c cinfo.c dir.c display.c \
 	echo.c extend.c file.c fileio.c funmap.c help.c kbd.c keymap.c \