diff options
| author | zeromake <[email protected]> | 2023-11-01 23:24:20 +0800 |
|---|---|---|
| committer | zeromake <[email protected]> | 2023-11-01 23:24:20 +0800 |
| commit | 552f8e7af8846c4aa87040361bf8a1727d8c15d5 (patch) | |
| tree | d8d8b9aedda5b8f061d1bba7746c0e67b6843557 /xmake/modules/lib/detect/check_cxsnippets.lua | |
| parent | 63a5c56f2b26a46729800d1447b721604ffbcbf3 (diff) | |
fix: binaryfind use match pattern
Diffstat (limited to 'xmake/modules/lib/detect/check_cxsnippets.lua')
| -rw-r--r-- | xmake/modules/lib/detect/check_cxsnippets.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua index d74499ea3..310c55fa0 100644 --- a/xmake/modules/lib/detect/check_cxsnippets.lua +++ b/xmake/modules/lib/detect/check_cxsnippets.lua @@ -259,7 +259,11 @@ function main(snippets, opt) end if opt.binaryfind then local content = io.readfile(binaryfile, {encoding = "binary"}) - return opt.binaryfind(content) + local match = content:match(opt.binaryfind) + if match == nil then + return false + end + return true, match end return true end, |
