summaryrefslogtreecommitdiff
path: root/xmake/core/base/xml.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-15 00:50:05 +0800
committerruki <[email protected]>2025-11-15 00:50:05 +0800
commit7c7c82fa43a10f89a8842ea51dca34f68a1a846d (patch)
tree1e99515f1240ebce4a4526c45b118912d776d74f /xmake/core/base/xml.lua
parentdc6a23d0752243d950b81628124fcaa9b907dabe (diff)
improve find in xml
Diffstat (limited to 'xmake/core/base/xml.lua')
-rw-r--r--xmake/core/base/xml.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/core/base/xml.lua b/xmake/core/base/xml.lua
index 07260959c..9bcbe420c 100644
--- a/xmake/core/base/xml.lua
+++ b/xmake/core/base/xml.lua
@@ -290,7 +290,7 @@ function xml.decode(data, opt)
table.insert(children, xml.cdata(value))
i = close + 3
elseif data:sub(lt + 1, lt + 8):upper() == "!DOCTYPE" then
- local close = data:find(">", lt + 8)
+ local close = data:find(">", lt + 8, true)
if not close then
return nil, "unterminated doctype declaration"
end
@@ -306,13 +306,13 @@ function xml.decode(data, opt)
end
i = close + 2
elseif data:sub(lt + 1, lt + 1) == "!" then
- local close = data:find(">", lt + 2)
+ local close = data:find(">", lt + 2, true)
if not close then
return nil, "unterminated xml declaration"
end
i = close + 1
elseif data:sub(lt + 1, lt + 1) == "/" then
- local close = data:find(">", lt + 1)
+ local close = data:find(">", lt + 1, true)
if not close then
return nil, "unterminated closing tag"
end
@@ -323,7 +323,7 @@ function xml.decode(data, opt)
end
i = close + 1
else
- local close = data:find(">", lt + 1)
+ local close = data:find(">", lt + 1, true)
if not close then
return nil, "unterminated opening tag"
end
@@ -440,7 +440,7 @@ function xml.scan(data, callback, opt)
emit(node)
i = close + 3
elseif data:sub(lt + 1, lt + 8):upper() == "!DOCTYPE" then
- local close = data:find(">", lt + 8)
+ local close = data:find(">", lt + 8, true)
if not close then
return nil, "unterminated doctype declaration"
end
@@ -458,13 +458,13 @@ function xml.scan(data, callback, opt)
end
i = close + 2
elseif data:sub(lt + 1, lt + 1) == "!" then
- local close = data:find(">", lt + 2)
+ local close = data:find(">", lt + 2, true)
if not close then
return nil, "unterminated xml declaration"
end
i = close + 1
elseif data:sub(lt + 1, lt + 1) == "/" then
- local close = data:find(">", lt + 1)
+ local close = data:find(">", lt + 1, true)
if not close then
return nil, "unterminated closing tag"
end
@@ -476,7 +476,7 @@ function xml.scan(data, callback, opt)
emit(node)
i = close + 1
else
- local close = data:find(">", lt + 1)
+ local close = data:find(">", lt + 1, true)
if not close then
return nil, "unterminated opening tag"
end