Merge pull request #279 from tigran123/master

Calculator: make it more robust.
This commit is contained in:
{Qingping,Dave} Hou
2012-09-14 10:23:10 -07:00

View File

@@ -604,8 +604,7 @@ function InputBox:ModeDependentCommands()
showInfoMsgWithDelay("No input ", 1000, 1)
else
local s = self:PrepareStringToCalc()
if pcall(function () f = assert(loadstring("r = tostring("..s..")")) end) then
f()
if pcall(function () f = assert(loadstring("r = tostring("..s..")")) end) and pcall(f) then
self:clearText()
self.cursor:clear()
for i=1, string.len(r) do