Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2016-02-03 22:19:29 +0300
committerSoumith Chintala <soumith@fb.com>2016-02-03 22:19:29 +0300
commit913db2787ea563175c6c7ad7e4898141fb80d15c (patch)
treeac43bab6cbce86e905c5fd57c982d24e86fea6f2
parent4f9aeefafb2234dfe3a7760290efc1c0408baab9 (diff)
fixing Cmdline:log to get the print function lazilycmdlineleak3
-rw-r--r--CmdLine.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/CmdLine.lua b/CmdLine.lua
index 7765d22..d4f73fb 100644
--- a/CmdLine.lua
+++ b/CmdLine.lua
@@ -187,9 +187,10 @@ function CmdLine:string(prefix, params, ignore)
end
end
-local oprint = print
+local oprint = nil
function CmdLine:log(file, params)
local f = io.open(file, 'w')
+ oprint = oprint or print -- get the current print function lazily
function print(...)
local n = select("#", ...)
local arg = {...}