Skip to content

Commit

Permalink
Fix escapeArg for Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 11, 2023
1 parent 00e45b7 commit 7efbcd5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ public static String escapeArg(String arg) {
if (m.matches()) {
return arg;
}
return "'" + arg.replace("'", "'\"'\"'") + "'";
return "'" + arg
.replace("'", "'\"'\"'")
.replace("\\", "\\\\") /* for Windows paths */
+ "'";
}


Expand Down

0 comments on commit 7efbcd5

Please sign in to comment.