fix: correctly handle CRLF on Windows in preset archive and json plugins (#2017)

This commit is contained in:
三咲雅 · Misaki Masa 2024-12-10 01:03:01 +08:00 committed by GitHub
parent a743488476
commit 7498b97251
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View file

@ -110,7 +110,7 @@ function M.list_files(args, skip, limit)
goto continue
end
key, value = next:match("^(%u%l+) = (.+)[\r\n]+")
key, value = next:match("^(%u%l+) = (.-)[\r\n]+")
if key == "Path" then
files[#files].path = value
elseif key == "Size" then

View file

@ -2,12 +2,7 @@ local M = {}
function M:peek(job)
local child = Command("jq")
:args({
"-C",
"--tab",
".",
tostring(job.file.url),
})
:args({ "-b", "-C", "--tab", ".", tostring(job.file.url) })
:stdout(Command.PIPED)
:stderr(Command.PIPED)
:spawn()