Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2010-08-24 03:00:33 +0000
committerAndrew Gvozdev2010-08-24 03:00:33 +0000
commit22a3b54035818f185c7a19c24ba9a0bda4f35c9f (patch)
tree902ca21b08bdf2c5f1b716995c06bb13b70cea9d
parent7479a020002fa586c936c3ba00dabb98a366b718 (diff)
downloadorg.eclipse.cdt-22a3b54035818f185c7a19c24ba9a0bda4f35c9f.tar.gz
org.eclipse.cdt-22a3b54035818f185c7a19c24ba9a0bda4f35c9f.tar.xz
org.eclipse.cdt-22a3b54035818f185c7a19c24ba9a0bda4f35c9f.zip
bug 323011: [Scanner Discovery] Source files with drive-relative paths ("/foo/bar.c") are not discovered
=1.12
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/ScannerInfoConsoleParserUtility.java27
1 files changed, 23 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 84df833c8b5..6be1c0ce908 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
@@ -182,10 +182,24 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser
public List<String> translateRelativePaths(IFile file, String fileName, List<String> includes) {
List<String> translatedIncludes = new ArrayList<String>(includes.size());
- for (Iterator<String> i = includes.iterator(); i.hasNext(); ) {
- String include = i.next();
+ for (String include : includes) {
IPath includePath = new Path(include);
- if (!includePath.isAbsolute() && !includePath.isUNC()) { // do not translate UNC paths
+ if (includePath.isUNC()) {
+ // do not translate UNC paths
+ } else if (includePath.isAbsolute()) {
+ if (includePath.getDevice()==null) {
+ String device = getWorkingDirectory().getDevice();
+ IPath candidatePath = includePath.setDevice(device);
+ File dir = candidatePath.toFile();
+ if (dir.exists()) {
+ include = candidatePath.toString();
+ } else {
+ final String error = MakeMessages.getString("ConsoleParser.Nonexistent_Include_Path_Error_Message"); //$NON-NLS-1$
+ TraceUtil.outputError(error, include);
+// generateMarker(file, -1, error+include, IMarkerGenerator.SEVERITY_WARNING, fileName);
+ }
+ }
+ } else {
// First try the current working directory
IPath cwd = getWorkingDirectory();
if (!cwd.isAbsolute()) {
@@ -193,7 +207,12 @@ public class ScannerInfoConsoleParserUtility extends AbstractGCCBOPConsoleParser
}
IPath filePath = new Path(fileName);
- if (!filePath.isAbsolute()) {
+ if (filePath.isAbsolute()) {
+ if (filePath.getDevice()==null) {
+ String device = getWorkingDirectory().getDevice();
+ filePath = filePath.setDevice(device);
+ }
+ } else {
// check if the cwd is the right one
// appending fileName to cwd should yield file path
filePath = cwd.append(fileName);

Back to the top