diff options
Diffstat (limited to 'img')
-rw-r--r-- | img/driver.lua | 18 |
1 files changed, 10 insertions, 8 deletions
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 |