Skip to content

Commit f29f71d

Browse files
authored
[1.x] Fix # in user supplied program arguments being ignored (#164)
1 parent 35493f4 commit f29f71d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/net/neoforged/moddevgradle/internal/RunUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ private RunUtils() {
5858

5959
public static String escapeJvmArg(String arg) {
6060
var escaped = arg.replace("\\", "\\\\").replace("\"", "\\\"");
61-
if (escaped.contains(" ")) {
61+
// # is used for line comments in arg files and should be quoted to avoid misinterpretation
62+
if (escaped.contains(" ") || escaped.contains("#")) {
6263
return "\"" + escaped + "\"";
6364
}
6465
return escaped;

0 commit comments

Comments
 (0)