texlive[46237] Build/source/texk/web2c/pdftexdir: output non-pdf

commits+karl at tug.org commits+karl at tug.org
Sun Jan 7 01:25:31 CET 2018


Revision: 46237
          http://tug.org/svn/texlive?view=revision&revision=46237
Author:   karl
Date:     2018-01-07 01:25:31 +0100 (Sun, 07 Jan 2018)
Log Message:
-----------
output non-pdf special being ignored, from pdftex r792

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=792

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
    trunk/Build/source/texk/web2c/pdftexdir/NEWS
    trunk/Build/source/texk/web2c/pdftexdir/pdftex.web

Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2018-01-06 21:55:26 UTC (rev 46236)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2018-01-07 00:25:31 UTC (rev 46237)
@@ -1,3 +1,10 @@
+2018-01-06  Karl Berry  <karl at freefriends.org>
+
+	* pdftex.web (literal): if a non-PDF special is ignored,
+	also output "<special> " and the first 64 characters of the special.
+	(slow_print_substr): new procedure, although surely there's
+	already a way to print a substring of a pool string.
+
 2018-01-01  Pali Roh\'ar <pali.rohar at gmail.com>
 
 	Patch 1: explicitly detect bitmap PK font in fm_scan_line,

Modified: trunk/Build/source/texk/web2c/pdftexdir/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/NEWS	2018-01-06 21:55:26 UTC (rev 46236)
+++ trunk/Build/source/texk/web2c/pdftexdir/NEWS	2018-01-07 00:25:31 UTC (rev 46237)
@@ -2,6 +2,8 @@
   - do not hash current directory into PDF ID, for more reproducible builds
     (pdftex r782).
   - allow encoding vectors for bitmap PK fonts (r790).
+  - when a non-PDF special is ignored, output a (leading substring of the)
+  special, preceded by "<special> ".
 
 - bugfixes:
   - \pdfprimitive does nothing, rather than give an error, when given a

Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2018-01-06 21:55:26 UTC (rev 46236)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2018-01-07 00:25:31 UTC (rev 46237)
@@ -16249,6 +16249,19 @@
     pdf_print_ln("]");
 end;
 
+{Prints first |len| characters of string |s| (if it's that long).
+ There must be a better way to print a substring?}
+procedure slow_print_substr(@!s,@!max_len:integer);
+var j:pool_pointer; {current character code position}
+begin if (s>=str_ptr) or (s<256) then print(s)
+else begin j:=str_start[s];
+  while (j<str_start[s+1]) and (j<=str_start[s]+max_len) do
+    begin print(so(str_pool[j])); incr(j);
+    end;
+  end;
+  if j<str_start[s+1] then print("..."); {indicate truncation}
+end;
+
 procedure literal(s: str_number; literal_mode: integer; warn: boolean);
 var j: pool_pointer; {current character code position}
 begin
@@ -16257,8 +16270,13 @@
         if not (str_in_str(s, "PDF:", 0) or str_in_str(s, "pdf:", 0)) then begin
             if warn and not (str_in_str(s, "SRC:", 0)
                 or str_in_str(s, "src:", 0)
-                or (length(s) = 0)) then
+                or (length(s) = 0)) then begin
                     print_nl("Non-PDF special ignored!");
+                    print_nl("<special> ");
+                    slow_print_substr(s, 64);
+                    {length of printed line should be <=78; good enough.}
+                    print_ln;
+            end;
             return;
         end;
         j := j + length("PDF:");



More information about the tex-live-commits mailing list