Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lindo2011-08-12 18:43:10 +0000
committerAndrew Gvozdev2011-08-12 18:49:39 +0000
commitac8574515bf178709504b87d8b4fc500da0dcb47 (patch)
tree6056970a84047e2e22bc182537418f7b01df23ec
parent60dabd8ceb4ba3d9b1a3a427626de63d0c05713b (diff)
downloadorg.eclipse.cdt-ac8574515bf178709504b87d8b4fc500da0dcb47.tar.gz
org.eclipse.cdt-ac8574515bf178709504b87d8b4fc500da0dcb47.tar.xz
org.eclipse.cdt-ac8574515bf178709504b87d8b4fc500da0dcb47.zip
bug 354042: Problem with include paths that are relative paths starting
with ../ or./ and NPE
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java
index 9435c35632a..6ad7efeff3c 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -87,9 +87,13 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser
}
if (file!=null) {
- String filePath = new Path(fileName).toString();
- String foundLocation = file.getLocation().toString();
- if (!foundLocation.endsWith(filePath)) {
+ IPath filePath = new Path(fileName);
+ if(filePath.segment(0).compareTo("..") == 0) { //$NON-NLS-1$
+ filePath = filePath.removeFirstSegments(1);
+ }
+
+ String foundLocation = file.getLocationURI().toString();
+ if (!foundLocation.endsWith(filePath.toString())) {
file = null;
}
}

Back to the top