Skip to content

Commit 4dcf4f2

Browse files
authored
Merge pull request github#10819 from github/igfoo/kotlin
Kotlin: Some windows fixes
2 parents 407f707 + 7d22bdb commit 4dcf4f2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinExtractorExtension.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class KotlinExtractorExtension(
7474
// First, if we can find our log directory, then let's try
7575
// making a log file there:
7676
val extractorLogDir = System.getenv("CODEQL_EXTRACTOR_JAVA_LOG_DIR")
77-
if (extractorLogDir != null || extractorLogDir != "") {
77+
if (extractorLogDir != null && extractorLogDir != "") {
7878
// We use a slightly different filename pattern compared
7979
// to normal logs. Just the existence of a `-top` log is
8080
// a sign that something's gone very wrong.
@@ -296,7 +296,9 @@ private fun doFile(
296296
context.clear()
297297
}
298298

299-
val dbSrcFilePath = Paths.get("$dbSrcDir/$srcFilePath")
299+
val srcFileRelativePath = srcFilePath.replace(':', '_')
300+
301+
val dbSrcFilePath = Paths.get("$dbSrcDir/$srcFileRelativePath")
300302
val dbSrcDirPath = dbSrcFilePath.parent
301303
Files.createDirectories(dbSrcDirPath)
302304
val srcTmpFile = File.createTempFile(dbSrcFilePath.fileName.toString() + ".", ".src.tmp", dbSrcDirPath.toFile())
@@ -305,7 +307,7 @@ private fun doFile(
305307
}
306308
srcTmpFile.renameTo(dbSrcFilePath.toFile())
307309

308-
val trapFileName = "$dbTrapDir/$srcFilePath.trap"
310+
val trapFileName = "$dbTrapDir/$srcFileRelativePath.trap"
309311
val trapFileWriter = getTrapFileWriter(compression, logger, trapFileName)
310312

311313
if (checkTrapIdentical || !trapFileWriter.exists()) {

0 commit comments

Comments
 (0)