Skip to content

Commit 4e140f1

Browse files
committed
lib/dtutils/system - fixed Lua escaping in windows_command()
1 parent 593f804 commit 4e140f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/dtutils/system.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,13 @@ function dtutils_system.windows_command(command)
8686
local file = io.open(fname, "w")
8787
if file then
8888
dt.print_log("opened file")
89-
command = string.gsub(command, "%%", "%%%%") -- escape % from windows shell
9089
file:write("@echo off\n")
9190
file:write('for /f "tokens=2 delims=:." %%x in (\'chcp\') do set cp=%%x\n')
9291
file:write("chcp 65001>nul\n") -- change the encoding of the terminal to handle non-english characters in path
9392
file:write("\n")
9493
file:write(command .. "\n")
9594
file:write("\n")
96-
file:write("chcp %%cp%%>nul\n")
95+
file:write("chcp %cp%>nul\n")
9796
file:close()
9897

9998
result = dt.control.execute(fname)

0 commit comments

Comments
 (0)