Skip to content

Commit 3f5cf06

Browse files
authored
Merge pull request darktable-org#230 from Mark-64/fix_lib
Sanitize filepath before checking for its existance in Windows (fix darktable-org#229)
2 parents 1ec9cfb + 635ea3f commit 3f5cf06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dtutils/file.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function dtutils_file.check_if_file_exists(filepath)
230230
local result = false
231231
if (dt.configuration.running_os == 'windows') then
232232
filepath = string.gsub(filepath, '[\\/]+', '\\')
233-
local p = io.popen("if exist " .. filepath .. " (echo 'yes') else (echo 'no')")
233+
local p = io.popen("if exist " .. dtutils_file.sanitize_filename(filepath) .. " (echo 'yes') else (echo 'no')")
234234
local ans = p:read("*all")
235235
p:close()
236236
if string.match(ans, "yes") then

0 commit comments

Comments
 (0)