### Eclipse Workspace Patch 1.0 #P org.eclipse.cdt.core Index: model/org/eclipse/cdt/internal/core/model/IncludeReference.java =================================================================== RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java,v retrieving revision 1.15 diff -u -r1.15 IncludeReference.java --- model/org/eclipse/cdt/internal/core/model/IncludeReference.java 23 Jun 2005 16:01:07 -0000 1.15 +++ model/org/eclipse/cdt/internal/core/model/IncludeReference.java 21 Sep 2006 18:43:13 -0000 @@ -127,6 +127,7 @@ * @see org.eclipse.cdt.core.model.IIncludeReference#isOnIncludeEntry(org.eclipse.core.runtime.IPath) */ public boolean isOnIncludeEntry(IPath path) { + path = Util.getCanonicalPath(path); if (fIncludeEntry.getIncludePath().isPrefixOf(path) && !CoreModelUtil.isExcluded(path, fIncludeEntry.fullExclusionPatternChars())) { return true; Index: model/org/eclipse/cdt/internal/core/model/Util.java =================================================================== RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java,v retrieving revision 1.20 diff -u -r1.20 Util.java --- model/org/eclipse/cdt/internal/core/model/Util.java 23 Jun 2006 17:26:52 -0000 1.20 +++ model/org/eclipse/cdt/internal/core/model/Util.java 21 Sep 2006 18:43:13 -0000 @@ -25,9 +25,7 @@ import org.eclipse.cdt.internal.core.model.IDebugLogConstants.DebugLogConstant; import org.eclipse.cdt.internal.core.util.CharArrayBuffer; import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.*; public class Util implements ICLogConstants { public static boolean VERBOSE_PARSER = false; @@ -36,6 +34,12 @@ public static String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$ + private static boolean hasCaseInsensitiveFileSystem; + + static { + hasCaseInsensitiveFileSystem = Platform.getOS().equals(Platform.OS_WIN32); + } + private Util() { } @@ -421,5 +425,17 @@ return null; } + /** + * Get a canonical IPath, for use in IPath#isPrefixOf, #equals, etc. + * to overcome a bug in Path that doesn't account for + * case-insensitive filesystems. + */ + public static IPath getCanonicalPath(IPath path) { + if (hasCaseInsensitiveFileSystem) { + // be stupid for now (instead of using File#toCanonicalFile()) + return new Path(path.toOSString().toLowerCase()); + } + return path; + } } Index: model/org/eclipse/cdt/internal/core/model/IncludeEntry.java =================================================================== RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java,v retrieving revision 1.22 diff -u -r1.22 IncludeEntry.java --- model/org/eclipse/cdt/internal/core/model/IncludeEntry.java 23 Jun 2006 17:52:41 -0000 1.22 +++ model/org/eclipse/cdt/internal/core/model/IncludeEntry.java 21 Sep 2006 18:43:13 -0000 @@ -24,7 +24,8 @@ public IncludeEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath includePath, boolean isSystemInclude, IPath[] exclusionPatterns, boolean isExported) { super(IPathEntry.CDT_INCLUDE, basePath, baseRef, resourcePath, exclusionPatterns, isExported); - this.includePath = (includePath == null) ? Path.EMPTY : includePath; + this.includePath = (includePath == null) ? Path.EMPTY : + Util.getCanonicalPath(includePath); this.isSystemInclude = isSystemInclude; }