From jabrown@stimpy.nlanr.net  Mon Feb 21 14:53:53 2000
Return-Path: <jabrown@stimpy.nlanr.net>
Received: from stimpy.nlanr.net (stimpy.nlanr.net [192.172.226.108])
	by hub.freebsd.org (Postfix) with ESMTP id A5CF337B517
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Feb 2000 14:53:52 -0800 (PST)
	(envelope-from jabrown@stimpy.nlanr.net)
Received: (from jabrown@localhost)
	by stimpy.nlanr.net (8.9.3/8.9.3) id OAA90039;
	Mon, 21 Feb 2000 14:52:18 -0800 (PST)
	(envelope-from jabrown)
Message-Id: <200002212252.OAA90039@stimpy.nlanr.net>
Date: Mon, 21 Feb 2000 14:52:18 -0800 (PST)
From: jabrown@caida.org
Sender: jabrown@stimpy.nlanr.net
Reply-To: jabrown@caida.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: dvipdfm port bugs and patches
X-Send-Pr-Version: 3.2

>Number:         16896
>Category:       ports
>Synopsis:       dvipdfm port chokes on some figures [PATCH INCLUDED]
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 21 15:00:01 PST 2000
>Closed-Date:    Thu Mar 9 09:45:08 PST 2000
>Last-Modified:  Thu Mar  9 09:45:36 PST 2000
>Originator:     Jeff Brown
>Release:        FreeBSD 3.3-RELEASE i386
>Organization:
>Environment:

3.3-R system with an up-to-date ports tree; dvipdfm-0.12.7 and teTeX-1.0.6 
ports.

>Description:

Two problems:

1) dvipdfm choked on the figures in my TeX document, reporting that it
couldn't find " jabs-random-figure.eps" -- note the leading space.  It
appears that one function is missing a call to the
whitespace-remover-o-matic.

2) once #1 was fixed, dvipdfm cored on a figure produced by tgif; it turns out
that dvipdfm was mis-identifying it as MetaPost postscript since the third
line, "%%Title: graph1:", is shorter than the string "%%Creator: MetaPost",
which was tripping up the comparison routine.



>How-To-Repeat:

Write a LaTeX document with an EPS figure made from tgif, and embedded with
the "\psfig{figure=...}" command.  Try dvipdfm on it.

>Fix:
	
To fix #1:

--- psspecial.c.orig    Mon Feb 21 14:00:47 2000
+++ psspecial.c Mon Feb 21 14:01:19 2000
@@ -192,6 +192,7 @@
 {
   char *filename;
   struct xform_info *p;
+  skip_white (start, end);
   if (*start < end && (filename = parse_ident (start, end))) {
 
     p = texfig_info ();


To fix #2:

--- mpost.c.orig        Mon Feb 21 14:11:49 2000
+++ mpost.c     Mon Feb 21 14:14:56 2000
@@ -49,12 +49,10 @@
   if (strncmp (work_buffer, "%!PS", 4))
     return 0;
   mfgets (work_buffer, WORK_BUFFER_SIZE, image_file);
-  if (strlen(work_buffer)>=strlen("%%BoundingBox") &&
-      strncmp (work_buffer, "%%BoundingBox", strlen("%%BoundingBox")))
+  if (strncmp (work_buffer, "%%BoundingBox", strlen("%%BoundingBox")))
     return 0;
   mfgets (work_buffer, WORK_BUFFER_SIZE, image_file);
-  if (strlen(work_buffer) >= strlen("%%Creator: MetaPost") &&
-      strncmp (work_buffer, "%%Creator: MetaPost", strlen("%%Creator: MetaPost")))
+  if (strncmp (work_buffer, "%%Creator: MetaPost", strlen("%%Creator: MetaPost")))
     return 0;
   return 1;
 }


>Release-Note:
>Audit-Trail:

From: Jeff Brown <jabrown@caida.org>
To: FreeBSD-gnats-submit@FreeBSD.ORG
Cc:  
Subject: Re: ports/16896: dvipdfm port bugs and patches
Date: Mon, 21 Feb 2000 15:25:48 -0800 (PST)

 As a follow-up, I have contacted the dvipdfm author with the given patches
 and he acknowledged them; I imagine they'll be fixed in the next release
 of the code, but in the meantime, my patches will keep dvipdfm users
 happy.
 
 
 		-Jeff Brown
 
 
State-Changed-From-To: open->closed 
State-Changed-By: ade 
State-Changed-When: Thu Mar 9 09:45:08 PST 2000 
State-Changed-Why:  
Patches committed, thanks! 
>Unformatted:
