[tldistro] RFC update tl2013 branch with various bug fixes

Norbert Preining preining at logic.at
Tue Sep 24 09:18:09 CEST 2013


Dear all,

maybe it helps the other distributors, so I post it here.
Karl, we might(?) update the tl2013 branch with this set or
even more fixes.

I have collected several fixes to bugs that have been done in
the current trunk development. Since there are many changes,
especially merge of the various dvipdf* programs, this does
not work simply by applying the patches.

Anyway, these are the patches we use in Debian for building
our binaries. The format is quilt patches with a series file,
but they simply can be applied.

If there are suggestions for othe patches or opposition, please
let me know.

The patch names and the respective svn commit message in trunk

upstream-svn31126-luatex
	luatex: printing of longinteger/off_t

upstream-svn31303-dvipdfmx
	dvipdfm-x: Bugfix (from xdvipdfmx r108)

upstream-svn31313-pdftex-luatex
	luaTeX, pdfTeX: treat unknown 'post' table versions as Version 3.0, i.e., without Glyph names

upstream-svn31350-dvips
	Fix a pTeX-extension bug in bbox.c.
	
upstream-svn31358-luatex
	Fix a bug in writecff.w: There was not pdf_end_dict() for the corresponding pdf_begin_dict().

upstream-svn31547-dvips
	Remove UniqueID in t1_subset_ascii_part(). Report from Christian Zietz.

upstream-svn31621-mendex
	mendexk: Bug fix [ptex:00349]

upstream-svn31735-metapost
	A bug in mp.w is fixed by Taco.


All the best

Norbert

------------------------------------------------------------------------
PREINING, Norbert                               http://www.preining.info
JAIST, Japan                                 TeX Live & Debian Developer
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
-------------- next part --------------
upstream-svn31126-luatex
upstream-svn31303-dvipdfmx
upstream-svn31313-pdftex-luatex
upstream-svn31350-dvips
upstream-svn31358-luatex
upstream-svn31547-dvips
upstream-svn31621-mendex
upstream-svn31735-metapost
-------------- next part --------------
upstream svn31126 fix for luatex
---
 texk/web2c/luatexdir/ChangeLog    |    5 +++++
 texk/web2c/luatexdir/pdf/pdfgen.w |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

--- texlive-bin.orig/texk/web2c/luatexdir/ChangeLog
+++ texlive-bin/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-05  Peter Breitenlohner  <peb at mppmu.mpg.de>
+
+	* pdf/pdfgen.w: Use "%"LONGINTEGER_PRI"d" format specifier to
+	print (LONGINTEGER_TYPE) casted longinteger and off_t variables.
+
 2013-06-27  Peter Breitenlohner  <peb at mppmu.mpg.de>
 
 	Bug fix for LuaTeX crash on 32bit Unix systems from Taco,
--- texlive-bin.orig/texk/web2c/luatexdir/pdf/pdfgen.w
+++ texlive-bin/texk/web2c/luatexdir/pdf/pdfgen.w
@@ -572,7 +572,7 @@
 {
     char s[24];
     int w;
-    w = snprintf(s, 23, "%" LONGINTEGER_PRI "d", n);
+    w = snprintf(s, 23, "%" LONGINTEGER_PRI "d", (LONGINTEGER_TYPE) n);
     check_nprintf(w, 23);
     pdf_out_block(pdf, (const char *) s, (size_t) w);
 }
@@ -719,7 +719,7 @@
     if (pdf->seek_write_length && pdf->draftmode == 0) {
         xfseeko(pdf->file, (off_t)pdf->stream_length_offset, SEEK_SET,
                 pdf->job_name);
-        fprintf(pdf->file, "%" LONGINTEGER_PRI "i", pdf->stream_length);
+        fprintf(pdf->file, "%" LONGINTEGER_PRI "i", (LONGINTEGER_TYPE) pdf->stream_length);
         xfseeko(pdf->file, 0, SEEK_END, pdf->job_name);
     }
     pdf->seek_write_length = false;
-------------- next part --------------
upstream svn31303 fix for dvipdfmx
---
 texk/dvipdfmx/src/jpegimage.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- texlive-bin.orig/texk/dvipdfmx/src/jpegimage.c
+++ texlive-bin/texk/dvipdfmx/src/jpegimage.c
@@ -360,7 +360,7 @@
     struct JPEG_APPn_JFIF *app_data;
     int i;
     for (i = 0; i < j_info->num_appn; i++) {
-      if (j_info->appn[i].marker  == JM_APP0 ||
+      if (j_info->appn[i].marker  == JM_APP0 &&
 	  j_info->appn[i].app_sig == JS_APPn_JFIF)
         break;
     }
-------------- next part --------------
upstream svn31313 fix for pdftex and luatex
---
 texk/web2c/luatexdir/ChangeLog       |    5 +++++
 texk/web2c/luatexdir/font/writettf.w |    7 +++----
 texk/web2c/pdftexdir/ChangeLog       |    5 +++++
 texk/web2c/pdftexdir/ttf2afm.c       |    6 +++---
 texk/web2c/pdftexdir/writettf.c      |    7 +++----
 5 files changed, 19 insertions(+), 11 deletions(-)

--- texlive-bin.orig/texk/web2c/luatexdir/ChangeLog
+++ texlive-bin/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-30  Peter Breitenlohner  <peb at mppmu.mpg.de>
+
+	* font/writettf.w: Treat unknown 'post' table versions
+	(found in some broken fonts) as 3.0, i.e., no Glyph names.
+
 2013-07-05  Peter Breitenlohner  <peb at mppmu.mpg.de>
 
 	* pdf/pdfgen.w: Use "%"LONGINTEGER_PRI"d" format specifier to
--- texlive-bin.orig/texk/web2c/luatexdir/font/writettf.w
+++ texlive-bin/texk/web2c/luatexdir/font/writettf.w
@@ -816,14 +816,13 @@
             }
         }
         break;
+    default:
+        pdftex_warn("unsupported format (%.8X) of `post' table, assuming 3.0",
+                    (unsigned int) post_format);
     case 0x00030000:
         for (glyph = glyph_tab; glyph - glyph_tab < NMACGLYPHS; glyph++) {
             glyph->name_index = (TTF_USHORT) (glyph - glyph_tab);
         }
-        break;
-    default:
-        pdftex_fail("unsupported format (%.8X) of `post' table",
-                    (unsigned int) post_format);
     }
 }
 
--- texlive-bin.orig/texk/web2c/pdftexdir/ChangeLog
+++ texlive-bin/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-30  Peter Breitenlohner  <peb at mppmu.mpg.de>
+
+	* ttf2afm.c, writettf.c: Treat unknown 'post' table versions
+	(found in some broken fonts) as 3.0, i.e., no Glyph names.
+
 2013-04-22  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* pdftex.web: pdftex_revision = "14"
--- texlive-bin.orig/texk/web2c/pdftexdir/ttf2afm.c
+++ texlive-bin/texk/web2c/pdftexdir/ttf2afm.c
@@ -521,15 +521,15 @@
             }
         }
         break;
+    default:
+        ttf_warn("unsupported format (%.8X) of `post' table, assuming 3.0",
+                 post_format);
     case 0x00030000:
         if (print_glyph == AS_NAME) {
             ttf_warn
                 ("no names available in `post' table, print glyph names as indices");
             print_glyph = AS_INDEX;
         }
-        break;
-    default:
-        ttf_fail("unsupported format (%.8X) of `post' table", post_format);
     }
     ttf_seek_tab("loca", 0);
     if (loca_format == 1) {
--- texlive-bin.orig/texk/web2c/pdftexdir/writettf.c
+++ texlive-bin/texk/web2c/pdftexdir/writettf.c
@@ -517,14 +517,13 @@
             }
         }
         break;
+    default:
+        pdftex_warn("unsupported format (%.8X) of `post' table, assuming 3.0",
+                    (unsigned int) post_format);
     case 0x00030000:
         for (glyph = glyph_tab; glyph - glyph_tab < NMACGLYPHS; glyph++) {
             glyph->name_index = glyph - glyph_tab;
         }
-        break;
-    default:
-        pdftex_fail("unsupported format (%.8X) of `post' table",
-                    (unsigned int) post_format);
     }
 }
 
-------------- next part --------------
upstream svn31350 fix dvips
---
 texk/dvipsk/ChangeLog |    5 +++++
 texk/dvipsk/bbox.c    |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

--- texlive-branch2013-source.svn.orig/texk/dvipsk/ChangeLog
+++ texlive-branch2013-source.svn/texk/dvipsk/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-05  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* bbox.c: Fix a bug in bbdopage() to obtain correct BoundingBox in
+	vertical mode of pTeX.
+
 2013-04-07  Karl Berry  <karl at tug.org>
 
 	* resident.c (getdefaults) <m>: if <= 0, set to INT_MAX.
--- texlive-branch2013-source.svn.orig/texk/dvipsk/bbox.c
+++ texlive-branch2013-source.svn/texk/dvipsk/bbox.c
@@ -346,8 +346,8 @@
             if (v - bcd->ury < lly) lly = v - bcd->ury;
             if (v - bcd->lly > ury) ury = v - bcd->lly;
          } else {
-            if (h + bcd->ury < llx) llx = h + bcd->ury;
-            if (h + bcd->lly > urx) urx = h + bcd->lly;
+            if (h + bcd->ury > urx) urx = h + bcd->ury;
+            if (h + bcd->lly < llx) llx = h + bcd->lly;
             if (v + bcd->llx < lly) lly = v + bcd->llx;
             if (v + bcd->urx > ury) ury = v + bcd->urx;
          }
-------------- next part --------------
upstream svn31358 fix for luatex
---
 texk/web2c/luatexdir/ChangeLog       |    5 +++++
 texk/web2c/luatexdir/font/writecff.w |    2 ++
 2 files changed, 7 insertions(+)

--- texlive-bin.orig/texk/web2c/luatexdir/ChangeLog
+++ texlive-bin/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-06  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* font/writecff.w: Fix a bug in write_cid_cff(). There was not
+	pdf_end_dict() for the corresponding pdf_begin_dict().
+
 2013-07-30  Peter Breitenlohner  <peb at mppmu.mpg.de>
 
 	* font/writettf.w: Treat unknown 'post' table versions
--- texlive-bin.orig/texk/web2c/luatexdir/font/writecff.w
+++ texlive-bin/texk/web2c/luatexdir/font/writecff.w
@@ -3389,6 +3389,8 @@
             }
             pdf_begin_obj(pdf, cidset, OBJSTM_NEVER);
             pdf_begin_dict(pdf);
+            pdf_dict_add_streaminfo(pdf);
+            pdf_end_dict(pdf);
             pdf_begin_stream(pdf);
             pdf_out_block(pdf, stream, l);
             pdf_end_stream(pdf);
-------------- next part --------------
upstream svn31547 fix for dvips
---
 texk/dvipsk/ChangeLog |    5 +++++
 texk/dvipsk/writet1.c |    4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

--- texlive-branch2013-source.svn.orig/texk/dvipsk/ChangeLog
+++ texlive-branch2013-source.svn/texk/dvipsk/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-31  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* writet1.c: Remove UniqueID in t1_subset_ascii_part().
+	Report from Christian Zietz (czietz at gmx.net tug.org).
+
 2013-08-05  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* bbox.c: Fix a bug in bbdopage() to obtain correct BoundingBox in
--- texlive-branch2013-source.svn.orig/texk/dvipsk/writet1.c
+++ texlive-branch2013-source.svn/texk/dvipsk/writet1.c
@@ -1167,7 +1167,9 @@
     t1_getline();
     while (!t1_prefix("/Encoding")) {
         t1_scan_param();
-        t1_putline();
+        if (!(t1_prefix("/UniqueID") &&
+            !strncmp(t1_line_array + strlen(t1_line_array) -4, "def", 3)))
+            t1_putline();
         t1_getline();
     }
     if (is_reencoded(fm_cur))
-------------- next part --------------
upstream svn31621 fix for mendex
---
 texk/mendexk/ChangeLog         |    9 +++++++++
 texk/mendexk/Makefile.am       |    9 +++++++++
 texk/mendexk/fwrite.c          |    4 ++--
 texk/mendexk/tests/foo.idx     |    3 +++
 texk/mendexk/tests/foo.ind     |    5 +++++
 texk/mendexk/tests/mendex.test |   16 ++++++++++++++++
 6 files changed, 44 insertions(+), 2 deletions(-)

--- texlive-bin.orig/texk/mendexk/ChangeLog
+++ texlive-bin/texk/mendexk/ChangeLog
@@ -1,3 +1,12 @@
+2013-09-10  Peter Breitenlohner  <peb at mppmu.mpg.de>
+
+	* fwrite.c: Bug fix as suggested by Akira, Karl, and Norbert.
+
+	* tests/mendex.test (new): Shell script for a test case.
+	* tests/foo.idx (new): Test input.
+	* tests/foo.ind (new): Expected output.
+	* Makefile.am: Adapted.
+
 2012-11-19  Peter Breitenlohner  <peb at mppmu.mpg.de>
 
 	* Makefile.am: Avoid use of deprecated INCLUDES.
--- texlive-bin.orig/texk/mendexk/Makefile.am
+++ texlive-bin/texk/mendexk/Makefile.am
@@ -50,3 +50,12 @@
 	indexsty \
 	mendex.doc
 
+## Tests
+##
+TESTS = tests/mendex.test
+EXTRA_DIST += $(TESTS)
+
+## tests/mendex.test
+EXTRA_DIST += tests/foo.idx tests/foo.ind
+DISTCLEANFILES = foo.*
+
--- texlive-bin.orig/texk/mendexk/fwrite.c
+++ texlive-bin/texk/mendexk/fwrite.c
@@ -15,7 +15,7 @@
 static void linecheck(char *lbuff, char *tmpbuff);
 static void crcheck(char *lbuff, FILE *fp);
 
-#define TAIL(x) (x+strlen(x))
+#define TAIL(x) ((x)+strlen(x))
 
 /* if we don't have vsnprintf() */
 /* #define vsnprintf(buff,len,format,argptr) vsprintf(buff,format,argptr) */
@@ -385,7 +385,7 @@
 					}
 					if (strlen(ind.p[j].enc)>0) {
 						sprintf(tmpbuff,"%s%s%s",encap_prefix,ind.p[j].enc,encap_infix);
-						sprintf(tmpbuff,"%s%s%s",ind.p[j].page,encap_suffix,delim_n);
+						sprintf(TAIL(tmpbuff),"%s%s%s",ind.p[j].page,encap_suffix,delim_n);
 						linecheck(lbuff,tmpbuff);
 					}
 				}
--- /dev/null
+++ texlive-bin/texk/mendexk/tests/foo.idx
@@ -0,0 +1,3 @@
+\indexentry{foo|(}{1}
+\indexentry{foo|mac}{1}
+\indexentry{foo|)}{1}
--- /dev/null
+++ texlive-bin/texk/mendexk/tests/foo.ind
@@ -0,0 +1,5 @@
+\begin{theindex}
+
+  \item foo, \mac{1}, 1
+
+\end{theindex}
--- /dev/null
+++ texlive-bin/texk/mendexk/tests/mendex.test
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+# Copyright (C) 2013 Peter Breitenlohner <tex-live at tug.org>
+# You may freely use, modify and/or distribute this file.
+
+TEXMFCNF=$srcdir/../kpathsea
+export TEXMFCNF
+
+rm -f foo.*
+
+./mendex $srcdir/tests/foo.idx -o foo.ind1 -t foo.ilg1 \
+	&& diff $srcdir/tests/foo.ind foo.ind1 || exit 1
+
+cat $srcdir/tests/foo.idx | ./mendex >foo.ind2 2>foo.ilg2 \
+	&& diff $srcdir/tests/foo.ind foo.ind2 || exit 1
+
-------------- next part --------------
upstream svn31735 fix for metapost
---
 texk/web2c/mplibdir/ChangeLog |    4 ++++
 texk/web2c/mplibdir/mp.w      |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

--- texlive-bin.orig/texk/web2c/mplibdir/ChangeLog
+++ texlive-bin/texk/web2c/mplibdir/ChangeLog
@@ -1,3 +1,7 @@
+2013-09-23  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* mp.w: A bug is fixed by Taco.
+
 2013-06-16 Taco Hoekwater  <taco at luatex.org>
 
 	Import metapost 1.803 (released version)
--- texlive-bin.orig/texk/web2c/mplibdir/mp.w
+++ texlive-bin/texk/web2c/mplibdir/mp.w
@@ -1,4 +1,4 @@
-% $Id: mp.w 1918 2013-06-13 12:47:55Z taco $
+% $Id: mp.w 1924 2013-09-20 15:02:58Z taco $
 %
 % This file is part of MetaPost;
 % the MetaPost program is in the public domain.
@@ -32727,7 +32727,7 @@
     mp_number arg1;
     new_number (arg1);
     number_clone (arg1, x);
-    number_multiply_int (x, 16);
+    number_multiply_int (arg1, 16);
     make_scaled (x, arg1, internal_value (mp_design_size));
     free_number (arg1);
   }


More information about the tldistro mailing list