[latex3-commits] [l3svn] branch master updated: l3build: Avoid 'data leak' when cycling lastline data

noreply at latex-project.org noreply at latex-project.org
Tue Jun 21 18:05:29 CEST 2016


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

The following commit(s) were added to refs/heads/master by this push:
       new  46315d7   l3build: Avoid 'data leak' when cycling lastline data
46315d7 is described below

commit 46315d707a2524a9ac9984ce51edfd32f2764335
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Jun 21 17:04:31 2016 +0100

    l3build: Avoid 'data leak' when cycling lastline data
    
    The old approach could lead to an issue if you were unlucky with
    a wrapped line.
---
 l3build/l3build.lua |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/l3build/l3build.lua b/l3build/l3build.lua
index c3f808a..67d951f 100644
--- a/l3build/l3build.lua
+++ b/l3build/l3build.lua
@@ -761,7 +761,7 @@ function formatlog(logfile, newfile, engine)
     return false
   end
     -- Substitutions to remove some non-useful changes
-  local function normalize(line)
+  local function normalize(line, lastline)
     -- Zap line numbers from \show, \showbox, \box_show and the like:
     -- do this before wrapping lines
     line = string.gsub(line, "^l%.%d+ ", "l. ...")
@@ -769,8 +769,7 @@ function formatlog(logfile, newfile, engine)
     -- Skip lines that have an explicit marker for truncation
     if string.len(line) == maxprintline  and
        not string.match(line, "%.%.%.$") then
-      lastline = (lastline or "") .. line
-      return ""
+      return "", (lastline or "") .. line
     end
     local line = (lastline or "") .. line
     lastline = ""
@@ -829,7 +828,7 @@ function formatlog(logfile, newfile, engine)
         line = string.gsub(line, utf8_char(i), "^^" .. string.format("%02x", i))
       end
     end
-    return line
+    return line, lastline
   end
   local lastline = ""
   local newlog = ""
@@ -845,7 +844,7 @@ function formatlog(logfile, newfile, engine)
     elseif string.match(line, "^%)?TIMO$") then
       skipping = false
     elseif not prestart and not skipping then
-      line = normalize(line)
+      line, lastline = normalize(line, lastline)
       if not string.match(line, "^ *$") and not killcheck(line) then
         newlog = newlog .. line .. os_newline
       end

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list