Skip to content

Commit

Permalink
Ensure backslashes in windows filename (#1555)
Browse files Browse the repository at this point in the history
cmd.exe doesn't work with '/' as path separator.

Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
  • Loading branch information
stefansli and MarkEWaite committed May 7, 2024
1 parent fbed205 commit 8e2ff51
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ private String windowsArgEncodeFileName(String filename) {
if (filename.contains("\"")) {
filename = filename.replace("\"", "^\"");
}
return "\"" + filename + "\"";
/* Ensure backslashes since cmd doesn't work with slashes as path separators */
return "\"" + filename.replace("/", "\\") + "\"";
}
}

Expand Down

0 comments on commit 8e2ff51

Please sign in to comment.