pdftex[792] branches/stable/source/src/texk/web2c/pdftexdir: output

commits+karl at tug.org commits+karl at tug.org
Sun Jan 7 01:24:42 CET 2018


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

Modified Paths:
--------------
    branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
    branches/stable/source/src/texk/web2c/pdftexdir/NEWS
    branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web

Modified: branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog	2018-01-02 00:15:54 UTC (rev 791)
+++ branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog	2018-01-07 00:24:41 UTC (rev 792)
@@ -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: branches/stable/source/src/texk/web2c/pdftexdir/NEWS
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/NEWS	2018-01-02 00:15:54 UTC (rev 791)
+++ branches/stable/source/src/texk/web2c/pdftexdir/NEWS	2018-01-07 00:24:41 UTC (rev 792)
@@ -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: branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web	2018-01-02 00:15:54 UTC (rev 791)
+++ branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web	2018-01-07 00:24:41 UTC (rev 792)
@@ -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 pdftex-commits mailing list