mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Kotlin: Handle /modules/... paths specially too
On Windows, we don't want a C: prefix on these either.
This commit is contained in:
@@ -15,12 +15,12 @@ public abstract class PathTransformer {
|
|||||||
*/
|
*/
|
||||||
public String fileAsDatabaseString(File file) {
|
public String fileAsDatabaseString(File file) {
|
||||||
String path = file.getPath();
|
String path = file.getPath();
|
||||||
// For a /!unknown-binary-location/... path, on Windows
|
// For /!unknown-binary-location/... and /modules/...
|
||||||
// the standard code wants to normalise it to
|
// paths, on Windows the standard code wants to
|
||||||
// C:/!unknown-binary-location/...
|
// normalise them to e.g. C:/!unknown-binary-location/...
|
||||||
// which is particularly annoying for cross-platform test
|
// which is particularly annoying for cross-platform test
|
||||||
// output. We therefore handle it specially here.
|
// output. We therefore handle them specially here.
|
||||||
if (path.matches("^[/\\\\]!unknown-binary-location[/\\\\].*")) {
|
if (path.matches("^[/\\\\](!unknown-binary-location|modules)[/\\\\].*")) {
|
||||||
return path.replace('\\', '/');
|
return path.replace('\\', '/');
|
||||||
}
|
}
|
||||||
if (Boolean.valueOf(Env.systemEnv().get(Var.SEMMLE_PRESERVE_SYMLINKS)))
|
if (Boolean.valueOf(Env.systemEnv().get(Var.SEMMLE_PRESERVE_SYMLINKS)))
|
||||||
|
|||||||
Reference in New Issue
Block a user