[tex-k] dvipsk

Akira Kakuto kakuto at fsci.fuk.kindai.ac.jp
Thu Jan 27 12:29:38 CET 2005


> > Oops.  I'm sure that's gonna break something.  What do we do?
> 
> A solution:
> In the Omega mode, search ofm first with mustexistflag=0.
> Then proceed as usual.

The following seems ok for my test dvi's. 
(orig's are from p4, not applied Peter's final patch)

Best regards,
Akira

--- protos.h.orig	Sun Jan 23 15:56:48 2005
+++ protos.h	Thu Jan 27 20:08:11 2005
@@ -269,9 +269,11 @@
 /* prototypes for functions from search.c */
 #ifdef KPATHSEA
 extern FILE *search P3H(kpse_file_format_type format, char *file, char *mode);
+extern FILE *search2 P3H(kpse_file_format_type format, char *file, char *mode);
 extern FILE *pksearch P6H(kpse_file_format_type format, char *file, char *mode, unsigned short dpi, char **name_ret , int *dpi_ret);
 #else /* !KPATSHEA */
 extern FILE *search P3H(char *path, char *file, char *mode);
+extern FILE *search2 P3H(char *path, char *file, char *mode);
 extern FILE *pksearch P6H(char *path, char *file, char *mode, unsigned short dpi, char **name_ret , int *dpi_ret);
 #endif /* KPATHSEA */
 extern FILE *my_real_fopen P2H(char *n, char *t);
--- search.c.orig	Fri Mar 12 00:29:42 2004
+++ search.c	Thu Jan 27 20:09:08 2005
@@ -125,6 +125,52 @@
 }               /* end search */
 
 FILE *
+search2 P3C(kpse_file_format_type, format, char *, file, char *, mode)
+{
+  FILE *ret;
+  string found_name;
+
+#ifdef SECURE
+  /* This change suggested by maj at cl.cam.ac.uk to disallow reading of
+     arbitrary files.  */
+  if (secure && kpse_absolute_p (file)) return NULL;
+#endif
+
+  found_name = kpse_find_file (file, format, 0);
+
+  if (found_name) {
+    unsigned len = strlen (found_name);
+#ifndef AMIGA
+    if ((format == figpath || format == headerpath)
+        && ((len > 2 && FILESTRCASEEQ (found_name + len - 2, ".Z"))
+            || (len > 3 && FILESTRCASEEQ (found_name + len - 3, ".gz")))) {
+/* FIXME : use zlib instead of gzip ! */
+      char *cmd = concat3 (GUNZIP, " -c ", found_name);
+      ret = popen (cmd, "r");
+      to_close = USE_PCLOSE ;
+    } else {
+#endif /* not AMIGA */
+      ret = fopen (found_name, mode);
+      to_close = USE_FCLOSE ;
+#ifndef AMIGA
+    }
+#endif /* not AMIGA */
+    if (!ret)
+      FATAL_PERROR (found_name);
+    /* Free result of previous search.  */
+    if (realnameoffile)
+      free (realnameoffile);
+    /* Save in `name' and `realnameoffile' because other routines
+       access those globals.  Sigh.  */
+    realnameoffile = found_name;
+    strcpy(name, realnameoffile);
+  } else
+    ret = NULL;
+
+  return ret;
+}               /* end search */
+
+FILE *
 pksearch P6C(char *, path, char *, file, char *, mode,
 	     halfword, dpi, char **, name_ret, int *, dpi_ret)
 {
--- tfmload.c.orig	Sun Jan 23 15:56:50 2005
+++ tfmload.c	Thu Jan 27 20:11:29 2005
@@ -43,14 +43,34 @@
 {
   register char *n;
 #ifdef KPATHSEA
-  kpse_file_format_type d = tfmpath;
+  kpse_file_format_type d ;
 #else
    register char *d;
+#endif
+   n = fd->name ;
+   if (!noomega) {
+#ifdef KPATHSEA
+      d = ofmpath;
+#else
+      d = fd->area ;
+      if (*d==0)
+        d = ofmpath ;
+#endif
+#ifdef MVSXA   /* IBM: MVS/XA */
+      (void)sprintf(name, "ofm(%s)", n) ;
+#else
+      (void)sprintf(name, "%s.ofm", n) ;
+#endif
+      if ((tfmfile=search2(d, name, READBIN))!=NULL)
+         return ;
+   }
+#ifdef KPATHSEA
+   d = tfmpath;
+#else
    d = fd->area ;
    if (*d==0)
      d = tfmpath ;
 #endif
-   n = fd->name ;
 #ifdef MVSXA   /* IBM: MVS/XA */
    (void)sprintf(name, "tfm(%s)", n) ;
 #else
@@ -58,14 +78,6 @@
 #endif
    if ((tfmfile=search(d, name, READBIN))!=NULL)
       return ;
-   if (!noomega) {
-#ifdef KPATHSEA
-      d = ofmpath;
-#endif
-      (void)sprintf(name, "%s.ofm", n) ;
-      if ((tfmfile=search(d, name, READBIN))!=NULL)
-         return ;
-   }
    (void)sprintf(errbuf, "Can't open font metric file %s%s",
           fd->area, name) ;
    error(errbuf) ;



More information about the tex-k mailing list