From c76740968cda659e4a0e1b57c814c08019d4dcfb Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 7 Aug 2022 01:13:57 +0100 Subject: img --- img/driver.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'img') diff --git a/img/driver.lua b/img/driver.lua index eeb8f21..618c9bd 100644 --- a/img/driver.lua +++ b/img/driver.lua @@ -1,16 +1,18 @@ package.path = "/?;/?.lua;"..package.path _G.ERRLOG = {} -_G.oldprint = print -_G.print = function(...) - o = {} - for ix = 1,select('#',...) do - o[ix] = tostring(select(ix,...)) +if not _G.oldprint then + _G.oldprint = print + _G.print = function(...) + o = {} + for ix = 1,select('#',...) do + o[ix] = tostring(select(ix,...)) + end + table.insert(_G.ERRLOG,table.concat(o,"\t")) + _G.oldprint(...) end - table.insert(_G.ERRLOG,table.concat(o,"\t")) - _G.oldprint(...) + _G.rpr = function() _G.print = _G.oldprint _G.oldprint = nil end end -_G.rpr = function() _G.print = _G.oldprint end print("uu") local load_pnm = require("load_pnm").load -- cgit v1.2.3