From eb498336d1d3042cd7674b0d53f6bf5a5beb5173 Mon Sep 17 00:00:00 2001
From: markd <markd@pkgsrc.org>
Date: Sat, 19 Jun 2004 14:38:56 +0000
Subject: Revert part of 5.0.1 -> 5.0.2 that was leading to core dumps in xpdf
 and xdvi.  Fixes PR 25457. Bump PKGREVISION.

---
 fonts/t1lib/Makefile         |  4 ++--
 fonts/t1lib/distinfo         |  7 ++++---
 fonts/t1lib/patches/patch-ab | 41 ++++++++++++++++++++++++++++-------------
 fonts/t1lib/patches/patch-ad | 14 +++++++++++++-
 fonts/t1lib/patches/patch-ae | 21 +++++++++++++++++++++
 5 files changed, 68 insertions(+), 19 deletions(-)
 create mode 100644 fonts/t1lib/patches/patch-ae

diff --git a/fonts/t1lib/Makefile b/fonts/t1lib/Makefile
index caebfb41c3a..f6e912b0db0 100644
--- a/fonts/t1lib/Makefile
+++ b/fonts/t1lib/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.14 2004/04/19 04:30:03 minskim Exp $
+# $NetBSD: Makefile,v 1.15 2004/06/19 14:38:56 markd Exp $
 #
 
 DISTNAME=	t1lib-5.0.2
-PKGREVISION=	1
+PKGREVISION=	2
 CATEGORIES=	fonts devel graphics
 MASTER_SITES=	${MASTER_SITE_SUNSITE:=libs/graphics/} \
 		ftp://ftp.foolabs.com/pub/xpdf/
diff --git a/fonts/t1lib/distinfo b/fonts/t1lib/distinfo
index 58bfc873f35..6778b613854 100644
--- a/fonts/t1lib/distinfo
+++ b/fonts/t1lib/distinfo
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.6 2004/04/19 04:30:03 minskim Exp $
+$NetBSD: distinfo,v 1.7 2004/06/19 14:38:56 markd Exp $
 
 SHA1 (t1lib-5.0.2.tar.gz) = 71a6ec6c84a2e28a21f261be865e0dabe52daeb5
 Size (t1lib-5.0.2.tar.gz) = 1697086 bytes
 SHA1 (patch-aa) = 1a09e0f8c3b35987a963bd73b2d18722c0a67fba
-SHA1 (patch-ab) = 808dfa0b4cb8289078e3eb7d44428e6c2e57bc5e
+SHA1 (patch-ab) = 4dbcc243c125b27ada972219da25a807f8c5a138
 SHA1 (patch-ac) = aae10307ac7da8f095e7b294273503b5900e52aa
-SHA1 (patch-ad) = ff18028b165d9daba65a20510534ca6cc3b8d07d
+SHA1 (patch-ad) = ce242734ad7077ddd459c9d1c63fb88025d34de8
+SHA1 (patch-ae) = eaeaf0b4e57c01fdf907f075ae1c2872f237bbef
diff --git a/fonts/t1lib/patches/patch-ab b/fonts/t1lib/patches/patch-ab
index 60190a5ab8b..2b522753ceb 100644
--- a/fonts/t1lib/patches/patch-ab
+++ b/fonts/t1lib/patches/patch-ab
@@ -1,17 +1,32 @@
-$NetBSD: patch-ab,v 1.1 2004/04/19 04:14:35 simonb Exp $
+$NetBSD: patch-ab,v 1.2 2004/06/19 14:38:56 markd Exp $
 
---- lib/t1lib/t1base.c.orig	Sat Mar  6 12:58:04 2004
-+++ lib/t1lib/t1base.c
-@@ -138,7 +138,11 @@ void *T1_InitLib( int log)
-   char *logfilepath=NULL;
-   char *envlogreq=NULL;
-   int  usrforcelog=0;
+diff -ur t1lib-5.0.2/lib/t1lib/t1base.c t1lib-5.0.1/lib/t1lib/t1base.c
+--- t1lib-5.0.2/lib/t1lib/t1base.c	2004-03-06 14:58:04.000000000 +1300
++++ lib/t1lib/t1base.c	2004-02-02 14:16:16.000000000 +1300
+@@ -281,12 +276,7 @@
+ 		   T1LOG_WARNING);
+   }
+   
+-  /* Initialize builtin Standard Encoding */
+-  if ( !(Init_BuiltInEncoding()) ) {
+-      T1_PrintLog( "T1_InitLib()", "Unable initialize internal StandardEncoding!",
+-		   T1LOG_ERROR);
+-  }
 -  
-+  static int initdone;
 +
-+  if (initdone)
-+    return (pFontBase);
-+  initdone++;
-   
+   /* Set the default encoding to the fonts' internal encoding */
+   pFontBase->default_enc=NULL;
    
-   /* Reset T1_errno */
+@@ -507,12 +497,6 @@
+     else
+       error=1;
+ 
+-    /* Get rid of internal StandardEncoding vector */
+-    if ( StdEncArrayP != NULL ) {
+-      free( StdEncArrayP);
+-      StdEncArrayP = NULL;
+-    }
+-
+     /* Free search paths */
+     intT1_FreeSearchPaths();
+ 
diff --git a/fonts/t1lib/patches/patch-ad b/fonts/t1lib/patches/patch-ad
index 507512e3e94..26cb77fc7c0 100644
--- a/fonts/t1lib/patches/patch-ad
+++ b/fonts/t1lib/patches/patch-ad
@@ -1,5 +1,17 @@
-$NetBSD: patch-ad,v 1.1 2004/04/19 04:30:03 minskim Exp $
+$NetBSD: patch-ad,v 1.2 2004/06/19 14:38:56 markd Exp $
 
+diff -ur t1lib-5.0.2/lib/type1/scanfont.c t1lib-5.0.1/lib/type1/scanfont.c
+--- t1lib-5.0.2/lib/type1/scanfont.c	2004-03-06 14:58:26.000000000 +1300
++++ lib/type1/scanfont.c	2002-08-18 07:32:50.000000000 +1200
+@@ -248,7 +247,7 @@
+   int i;
+   psobj *encodingArrayP;
+  
+-  encodingArrayP = (psobj *)malloc(256*(sizeof(psobj)));
++  encodingArrayP = (psobj *)vm_alloc(256*(sizeof(psobj)));
+   if (!encodingArrayP)
+       return NULL;
+ 
 --- lib/type1/scanfont.c.orig	2004-03-05 19:58:26.000000000 -0600
 +++ lib/type1/scanfont.c
 @@ -1237,7 +1237,7 @@ int scan_font(FontP)
diff --git a/fonts/t1lib/patches/patch-ae b/fonts/t1lib/patches/patch-ae
new file mode 100644
index 00000000000..c19aa9b563e
--- /dev/null
+++ b/fonts/t1lib/patches/patch-ae
@@ -0,0 +1,21 @@
+$NetBSD: patch-ae,v 1.1 2004/06/19 14:38:56 markd Exp $
+
+diff -ur t1lib-5.0.2/lib/type1/fontfcn.c t1lib-5.0.1/lib/type1/fontfcn.c
+--- t1lib-5.0.2/lib/type1/fontfcn.c	2004-03-06 14:41:40.000000000 +1300
++++ lib/type1/fontfcn.c	2003-01-03 16:28:26.000000000 +1300
+@@ -57,6 +57,7 @@
+ 			 float line_thickness,
+ 			 float line_length,
+ 			 float strokewidth);
++extern  boolean Init_BuiltInEncoding( void);
+ void objFormatName(psobj *objP, int length, char *valueP);
+   
+ extern void T1io_reset( void);
+@@ -156,6 +157,7 @@
+ {
+   if (!(vm_init())) return(FALSE);
+   vm_base = vm_next_byte();
++  if (!(Init_BuiltInEncoding())) return(FALSE);
+   strcpy(CurFontName, "");    /* iniitialize to none */
+   FontP->vm_start = vm_next_byte();
+   FontP->FontFileName.len = 0;
-- 
cgit v1.2.3