mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 354042: Problem with include paths that are relative paths starting
with ../ or./ and NPE
This commit is contained in:
parent
67634ea7a8
commit
6dd117ec5e
1 changed files with 8 additions and 4 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -87,9 +87,13 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file!=null) {
|
if (file!=null) {
|
||||||
String filePath = new Path(fileName).toString();
|
IPath filePath = new Path(fileName);
|
||||||
String foundLocation = file.getLocation().toString();
|
if(filePath.segment(0).compareTo("..") == 0) { //$NON-NLS-1$
|
||||||
if (!foundLocation.endsWith(filePath)) {
|
filePath = filePath.removeFirstSegments(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
String foundLocation = file.getLocationURI().toString();
|
||||||
|
if (!foundLocation.endsWith(filePath.toString())) {
|
||||||
file = null;
|
file = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue