From f8487ba545b25103d084c1408518b1870102a48f Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 6 Dec 2022 13:44:56 +0200 Subject: [PATCH] [CLI] Filter out blank arguments from system environment --- .../kotlin/cli/common/arguments/parseCommandLineArguments.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt index 43132676e6b..c4d80b2e1c7 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/parseCommandLineArguments.kt @@ -72,7 +72,9 @@ fun parseCommandLineArguments(args: List, resu fun parseCommandLineArgumentsFromEnvironment(arguments: A) { val settingsFromEnvironment = CompilerSystemProperties.LANGUAGE_VERSION_SETTINGS.value?.takeIf { it.isNotEmpty() } - ?.split(Regex("""\s""")) ?: return + ?.split(Regex("""\s""")) + ?.filterNot { it.isBlank() } + ?: return parseCommandLineArguments(settingsFromEnvironment, arguments, overrideArguments = true) }