Skip to content

Commit bafa806

Browse files
committed
Kotlin: Handle /modules/... paths specially too
On Windows, we don't want a C: prefix on these either.
1 parent 0a470b0 commit bafa806

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/kotlin-extractor/src/main/java/com/semmle/util/trap/pathtransformers/PathTransformer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public abstract class PathTransformer {
1515
*/
1616
public String fileAsDatabaseString(File file) {
1717
String path = file.getPath();
18-
// For a /!unknown-binary-location/... path, on Windows
19-
// the standard code wants to normalise it to
20-
// C:/!unknown-binary-location/...
18+
// For /!unknown-binary-location/... and /modules/...
19+
// paths, on Windows the standard code wants to
20+
// normalise them to e.g. C:/!unknown-binary-location/...
2121
// which is particularly annoying for cross-platform test
22-
// output. We therefore handle it specially here.
23-
if (path.matches("^[/\\\\]!unknown-binary-location[/\\\\].*")) {
22+
// output. We therefore handle them specially here.
23+
if (path.matches("^[/\\\\](!unknown-binary-location|modules)[/\\\\].*")) {
2424
return path.replace('\\', '/');
2525
}
2626
if (Boolean.valueOf(Env.systemEnv().get(Var.SEMMLE_PRESERVE_SYMLINKS)))

0 commit comments

Comments
 (0)