diff options
author | koray kavukcuoglu <koray@kavukcuoglu.org> | 2013-10-27 22:33:52 +0400 |
---|---|---|
committer | koray kavukcuoglu <koray@kavukcuoglu.org> | 2013-10-27 22:33:52 +0400 |
commit | fb4f3b4bbf90a1a31349ab3f1641c5abdaabaa0d (patch) | |
tree | 0f4eebaff54a3b9aa8b8532bb4aea066a8944a4f /init.lua | |
parent | f9bbb451bc10cb507d59b40a1a26372d651d3d37 (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.lua | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |