@@ -2,6 +2,7 @@ package com.github.codeql
2
2
3
3
import com.github.codeql.utils.versions.usesK2
4
4
import com.semmle.util.files.FileUtil
5
+ import com.semmle.util.trap.pathtransformers.PathTransformer
5
6
import java.io.BufferedInputStream
6
7
import java.io.BufferedOutputStream
7
8
import java.io.BufferedReader
@@ -371,9 +372,9 @@ private fun doFile(
371
372
context.clear()
372
373
}
373
374
374
- val srcFileRelativePath = srcFilePath.replace( ' : ' , ' _ ' )
375
+ val srcFileRelativePath = PathTransformer .std().fileAsDatabaseString( File (srcFilePath) )
375
376
376
- val dbSrcFilePath = Paths .get( " $ dbSrcDir/ $ srcFileRelativePath" )
377
+ val dbSrcFilePath = FileUtil .appendAbsolutePath( dbSrcDir, srcFileRelativePath).toPath( )
377
378
val dbSrcDirPath = dbSrcFilePath.parent
378
379
Files .createDirectories(dbSrcDirPath)
379
380
val srcTmpFile =
@@ -385,7 +386,7 @@ private fun doFile(
385
386
srcTmpFile.outputStream().use { Files .copy(Paths .get(srcFilePath), it) }
386
387
srcTmpFile.renameTo(dbSrcFilePath.toFile())
387
388
388
- val trapFileName = " $dbTrapDir / $ srcFileRelativePath .trap"
389
+ val trapFileName = FileUtil .appendAbsolutePath(dbTrapDir, " $ srcFileRelativePath .trap" ).getAbsolutePath()
389
390
val trapFileWriter = getTrapFileWriter(compression, logger, trapFileName)
390
391
391
392
if (checkTrapIdentical || ! trapFileWriter.exists()) {
0 commit comments