From ee511b067a83bf81e3fdf4649b0ade606afa84c7 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 19 Sep 2024 13:57:54 +0200 Subject: [PATCH 1/2] Escape the '\' between " --- project/Build.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 6c6666b9f62b..3e5f595024b6 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -889,8 +889,8 @@ object Build { extraClasspath ++= Seq(dottyCompiler, dottyInterfaces, asm, dottyStaging, dottyTastyInspector, tastyCore, compilerInterface) } - val wrappedArgs = (if (printTasty) args else insertClasspathInArgs(args, extraClasspath.mkString(File.pathSeparator))).map(arg => "\""+ arg + "\"") - val fullArgs = main :: defaultOutputDirectory ::: wrappedArgs + val wrappedArgs = if (printTasty) args else insertClasspathInArgs(args, extraClasspath.mkString(File.pathSeparator)) + val fullArgs = main :: defaultOutputDirectory ::: wrappedArgs.map("\""+ _ + "\"").map(_.replace("\\", "\\\\")) (Compile / runMain).toTask(fullArgs.mkString(" ", " ", "")) }.evaluated, From 7aa4ac9d169b2c60dd6325ae6568abdb29a5c94b Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 19 Sep 2024 14:05:48 +0200 Subject: [PATCH 2/2] Also escape \ in the default output directory --- project/Build.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 3e5f595024b6..82ca537279bf 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -890,7 +890,7 @@ object Build { } val wrappedArgs = if (printTasty) args else insertClasspathInArgs(args, extraClasspath.mkString(File.pathSeparator)) - val fullArgs = main :: defaultOutputDirectory ::: wrappedArgs.map("\""+ _ + "\"").map(_.replace("\\", "\\\\")) + val fullArgs = main :: (defaultOutputDirectory ::: wrappedArgs).map("\""+ _ + "\"").map(_.replace("\\", "\\\\")) (Compile / runMain).toTask(fullArgs.mkString(" ", " ", "")) }.evaluated,