From 0dab2df25c87b8264af764d0598629dc6732f67b Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Tue, 16 Apr 2019 20:10:57 +0300 Subject: [PATCH] Escape file names that contain whitespaces --- .../src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 803e687dd03..ffd6177ba3e 100644 --- a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -112,7 +112,11 @@ abstract class KonanTest extends JavaExec { def sources = File.createTempFile(name,".lst") sources.deleteOnExit() def sourcesWriter = sources.newWriter() - filesToCompile.each {sourcesWriter << "$it\n"} + filesToCompile.each { f -> + sourcesWriter.write(f.chars().any { Character.isWhitespace(it) } + ? "\"$f\"\n" // escape file name + : "$f\n") + } sourcesWriter.close() args = ["-output", output, "@${sources.absolutePath}",