修复谜题数据解析时错误解析最后的空白符
This commit is contained in:
@@ -114,6 +114,7 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
|
|||||||
local _,__
|
local _,__
|
||||||
|
|
||||||
--Decode
|
--Decode
|
||||||
|
str=str:sub(str:find"%S",str:find".%s-$")
|
||||||
_,str=pcall(data.decode,"string","base64",str)
|
_,str=pcall(data.decode,"string","base64",str)
|
||||||
if not _ then return end
|
if not _ then return end
|
||||||
_,str=pcall(data.decompress,"string","zlib",str)
|
_,str=pcall(data.decompress,"string","zlib",str)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ function scene.keyDown(key)
|
|||||||
repeat table.remove(FIELD)until #FIELD==0
|
repeat table.remove(FIELD)until #FIELD==0
|
||||||
FIELD[1]=DATA.newBoard()
|
FIELD[1]=DATA.newBoard()
|
||||||
for i=4,#args do
|
for i=4,#args do
|
||||||
if not DATA.pasteBoard(args[i],i-3)and i<#args then goto THROW_fail end
|
if args[i]:find"%S"and not DATA.pasteBoard(args[i],i-3)and i<#args then goto THROW_fail end
|
||||||
end
|
end
|
||||||
freshMiniFieldVisible()
|
freshMiniFieldVisible()
|
||||||
LOG.print(text.importSuccess,COLOR.G)
|
LOG.print(text.importSuccess,COLOR.G)
|
||||||
|
|||||||
Reference in New Issue
Block a user