diff --git a/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/utils/CxxUtils.java b/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/utils/CxxUtils.java index 7b2dc336fb..34794de314 100644 --- a/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/utils/CxxUtils.java +++ b/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/utils/CxxUtils.java @@ -67,9 +67,9 @@ public static String normalizePath(String filename) { * @return returns case sensitive full path */ public static String normalizePathFull(String filename, String baseDir) { - String filePath = filename; File targetfile = new java.io.File(filename); - if (targetfile.exists()) { + String filePath; + if (targetfile.isAbsolute()) { filePath = normalizePath(filename); } else { // RATS, CppCheck and Vera++ provide names like './file.cpp' - add source folder for index check