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

github.com/torch/trepl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoray kavukcuoglu <koray@kavukcuoglu.org>2013-10-27 22:33:52 +0400
committerkoray kavukcuoglu <koray@kavukcuoglu.org>2013-10-27 22:33:52 +0400
commitfb4f3b4bbf90a1a31349ab3f1641c5abdaabaa0d (patch)
tree0f4eebaff54a3b9aa8b8532bb4aea066a8944a4f /init.lua
parentf9bbb451bc10cb507d59b40a1a26372d651d3d37 (diff)
boundary case corrected. if line fails and cmd is buggy, then return
error from loadstring > s=' ' > return s=='
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index a90b2a2..0295dc5 100644
--- a/init.lua
+++ b/init.lua
@@ -493,7 +493,11 @@ $endif
-- exec chunk:
if not cmd:match("^%s*$") then
- local ff=loadstring(cmd)
+ local ff,err=loadstring(cmd)
+ if not ff then
+ print(err)
+ return cmd:sub(1, -2)
+ end
local res = {xpcall(ff, traceback)}
local ok,err = res[1], res[2]
if not ok then