diff options
| author | ruki <[email protected]> | 2020-09-15 17:58:51 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-15 17:58:51 +0800 |
| commit | 0c4e3ec6428f762be3da95fdf1792a7287230eeb (patch) | |
| tree | de6d873677844f1ac9d45de7f3c7948c716dadbb /xmake/actions/require/impl/action/patch_sources.lua | |
| parent | b12caef38876cac6b31c7b96e7033464606022f4 (diff) | |
| parent | aaa29a3659d7b8a10c5196f5c035390045c9cf71 (diff) | |
Merge pull request #952 from Biobots/dev
fix patch apply issue
Diffstat (limited to 'xmake/actions/require/impl/action/patch_sources.lua')
| -rw-r--r-- | xmake/actions/require/impl/action/patch_sources.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/actions/require/impl/action/patch_sources.lua b/xmake/actions/require/impl/action/patch_sources.lua index f1be7eb60..eff4df42b 100644 --- a/xmake/actions/require/impl/action/patch_sources.lua +++ b/xmake/actions/require/impl/action/patch_sources.lua @@ -36,7 +36,9 @@ function _check_sha256(patch_hash, patch_file) -- local tmpfile = os.tmpfile(patch_file) os.cp(patch_file, tmpfile) - io.gsub(tmpfile, '\r\n', '\n') + local content = io.readfile(tmpfile, {encoding = "binary"}) + content = content:gsub('\r\n', '\n') + io.writefile(tmpfile, content, {encoding = "binary"}) ok = (patch_hash == hash.sha256(tmpfile)) os.rm(tmpfile) end |
