Skip to content

Commit 923fb06

Browse files
michelouallanrenucci
authored andcommitted
Fix for new lines on Windows (#5814)
1 parent f37526b commit 923fb06

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/src/dotty/tools/dotc/printing/Texts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ object Texts {
117117
case _ =>
118118
var follow = false
119119
for (elem <- relems.reverse) {
120-
if (follow) sb.append("\n")
120+
if (follow) sb.append(System.lineSeparator)
121121
elem.print(sb, numberWidth)
122122
follow = true
123123
}

compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package tools
33
package vulpix
44

55
import java.io.{ File => JFile, InputStreamReader, BufferedReader, PrintStream }
6-
import java.nio.file.Paths;
6+
import java.nio.file.Paths
77
import java.util.concurrent.atomic.AtomicBoolean
88
import java.util.concurrent.TimeoutException
99

@@ -156,10 +156,9 @@ trait RunnerOrchestration {
156156
* scala library.
157157
*/
158158
private def createProcess: Process = {
159-
val sep = JFile.separator
160159
val url = classOf[ChildJVMMain].getProtectionDomain.getCodeSource.getLocation
161160
val cp = Paths.get(url.toURI).toString + JFile.pathSeparator + Properties.scalaLibrary
162-
val javaBin = sys.props("java.home") + sep + "bin" + sep + "java"
161+
val javaBin = Paths.get(sys.props("java.home"), "bin", "java").toString
163162
new ProcessBuilder(javaBin, "-Dfile.encoding=UTF-8", "-Xmx1g", "-cp", cp, "dotty.tools.vulpix.ChildJVMMain")
164163
.redirectErrorStream(true)
165164
.redirectInput(ProcessBuilder.Redirect.PIPE)

0 commit comments

Comments
 (0)