Skip to content

Commit 73e3705

Browse files
committed
Fix Windows curl command percent-sign escaping
The Windows curl command was using `%%%%{http_code}` which after Lua's string.format() became `%%{http_code}`. This worked in cmd.exe batch files but failed in Git Bash and direct io.popen() execution, where the double-percent was interpreted literally. Changed to `%%{http_code}` (same as Unix) since io.popen() executes commands directly, not through a batch file interpreter. Closes #1
1 parent 585555f commit 73e3705

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_extensions/linkrot/linkrot.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ end
145145
local function build_windows_curl_command(url)
146146
local escaped_url = url:gsub('"', '""')
147147
return string.format(
148-
'curl.exe -s -o NUL -w "%%%%{http_code}" -L --max-time %d -A "%s" "%s" 2>NUL',
148+
'curl.exe -s -o NUL -w "%%{http_code}" -L --max-time %d -A "%s" "%s" 2>NUL',
149149
config.timeout,
150150
config.user_agent,
151151
escaped_url

0 commit comments

Comments
 (0)