The LIBRARY define is undocumenteed and triggers the same conditional
inclusions as PURIFY does.
See the diff below, no binary change.
cheers,
natano
Index: cl/cl_main.c
===================================================================
RCS file: /cvs/src/usr.bin/vi/cl/cl_main.c,v
retrieving revision 1.24
diff -u -r1.24 cl_main.c
--- cl/cl_main.c 14 Nov 2014 20:27:03 -0000 1.24
+++ cl/cl_main.c 15 Nov 2014 10:34:11 -0000
@@ -128,7 +128,7 @@
}
/* Free the global and CL private areas. */
-#if defined(DEBUG) || defined(PURIFY) || defined(LIBRARY)
+#if defined(DEBUG) || defined(PURIFY)
free(clp);
free(gp);
#endif
Index: common/main.c
===================================================================
RCS file: /cvs/src/usr.bin/vi/common/main.c,v
retrieving revision 1.24
diff -u -r1.24 main.c
--- common/main.c 14 Nov 2014 20:27:03 -0000 1.24
+++ common/main.c 15 Nov 2014 10:34:23 -0000
@@ -461,7 +461,7 @@
perl_end(gp);
#endif
-#if defined(DEBUG) || defined(PURIFY) || defined(LIBRARY)
+#if defined(DEBUG) || defined(PURIFY)
{ FREF *frp;
/* Free FREF's. */
while ((frp = TAILQ_FIRST(&gp->frefq))) {
@@ -505,13 +505,13 @@
(void)fprintf(stderr, "%s%.*s",
mp->mtype == M_ERR ? "ex/vi: " : "", (int)mp->len, mp->buf);
LIST_REMOVE(mp, q);
-#if defined(DEBUG) || defined(PURIFY) || defined(LIBRARY)
+#if defined(DEBUG) || defined(PURIFY)
free(mp->buf);
free(mp);
#endif
}
-#if defined(DEBUG) || defined(PURIFY) || defined(LIBRARY)
+#if defined(DEBUG) || defined(PURIFY)
/* Free any temporary space. */
if (gp->tmp_bp != NULL)
free(gp->tmp_bp);
Index: perl_api/perl.xs
===================================================================
RCS file: /cvs/src/usr.bin/vi/perl_api/perl.xs,v
retrieving revision 1.4
diff -u -r1.4 perl.xs
--- perl_api/perl.xs 27 Oct 2009 23:59:47 -0000 1.4
+++ perl_api/perl.xs 15 Nov 2014 10:34:53 -0000
@@ -74,7 +74,7 @@
/*Irestartop = 0; / * XXX */
perl_run(gp->perl_interp);
perl_destruct(gp->perl_interp);
-#if defined(DEBUG) || defined(PURIFY) || defined(LIBRARY)
+#if defined(DEBUG) || defined(PURIFY)
perl_free(gp->perl_interp);
#endif
}