mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #279 from tigran123/master
Calculator: make it more robust.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user