From d06be0ca83d553be50c99ec803baf158e7d53c52 Mon Sep 17 00:00:00 2001 From: guwirth Date: Mon, 31 Aug 2015 10:47:44 +0200 Subject: [PATCH] fix normalizePathFull - create absolute path with base dir only if filename is relative - close #618 --- .../src/main/java/org/sonar/plugins/cxx/utils/CxxUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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