From 4aad3e762aeddcd6f602949fc21d8227f15efed1 Mon Sep 17 00:00:00 2001 From: Vladimir Hirsl Date: Fri, 31 Dec 2004 17:46:15 +0000 Subject: [PATCH] Fix for PR 82052 [ScannerConfig] new Mozilla Standard C++ project has weird Discovery paths with errors. In ScannerInfoConsoleParserUtility - Absolute include paths are correctly handled in translateRelativePaths(..). - Corrected normalization of paths ending with single dot in normalizePath(..) --- .../util/ScannerInfoConsoleParserUtility.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java index 76cdfe5f97a..f374fc903fe 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/ScannerInfoConsoleParserUtility.java @@ -333,9 +333,13 @@ public class ScannerInfoConsoleParserUtility implements IScannerInfoConsoleParse if (!cwd.isAbsolute()) { cwd = fProject.getLocation().append(cwd); } - // check if the cwd is the right one - // appending fileName to cwd should yield file path - IPath filePath = cwd.append(fileName); + + IPath filePath = new Path(fileName); + if (!filePath.isAbsolute()) { + // check if the cwd is the right one + // appending fileName to cwd should yield file path + filePath = cwd.append(fileName); + } if (!filePath.toString().equalsIgnoreCase(file.getLocation().toString())) { // must be the cwd is wrong // check if file name starts with ".." @@ -409,6 +413,7 @@ public class ScannerInfoConsoleParserUtility implements IScannerInfoConsoleParse int ddot = buf.indexOf("..", ssp);//$NON-NLS-1$ if (sdot < ddot || ddot == -1) { newBuf.append(buf.substring(scp, sdot)); + scp = sdot; ssp = sdot + 1; if (ssp < len) { if (sdot == 0 || buf.charAt(sdot - 1) == '/' || buf.charAt(sdot - 1) == '\\') {