diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java index 6452331ba73..956b4eea8b5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java @@ -865,10 +865,20 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable { private T findInclusion(final String includeDirective, final boolean quoteInclude, final boolean includeNext, final String currentFile, final IIncludeFileTester tester) { T reader = null; - // filename is an absolute path or it is a Linux absolute path on a windows machine - if (new File(includeDirective).isAbsolute() || includeDirective.startsWith("/")) { //$NON-NLS-1$ + // Filename is an absolute path + if (new File(includeDirective).isAbsolute()) { return tester.checkFile(includeDirective, false, null); } + // Filename is a Linux absolute path on a windows machine + if (File.separatorChar == '\\' && includeDirective.length() > 0) { + final char firstChar = includeDirective.charAt(0); + if (firstChar == '\\' || firstChar == '/') { + if (currentFile != null && currentFile.length() > 1 && currentFile.charAt(1) == ':') { + return tester.checkFile(currentFile.substring(0, 2) + includeDirective, false, null); + } + return tester.checkFile(includeDirective, false, null); + } + } if (currentFile != null && quoteInclude && !includeNext) { // Check to see if we find a match in the current directory