diff options
author | Soumith Chintala <soumith@fb.com> | 2016-02-03 22:19:29 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@fb.com> | 2016-02-03 22:19:29 +0300 |
commit | 913db2787ea563175c6c7ad7e4898141fb80d15c (patch) | |
tree | ac43bab6cbce86e905c5fd57c982d24e86fea6f2 | |
parent | 4f9aeefafb2234dfe3a7760290efc1c0408baab9 (diff) |
fixing Cmdline:log to get the print function lazilycmdlineleak3
-rw-r--r-- | CmdLine.lua | 3 |
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 = {...} |