1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Follow up for symbolic links in include search path, bug 246524.

This commit is contained in:
Markus Schorn 2008-09-17 09:15:13 +00:00
parent 2e490426a7
commit e43c9eb5a9

View file

@ -114,17 +114,16 @@ public class IndexLocationFactory {
*/
public static IIndexFileLocation getIFLExpensive(ICProject cproject, String absolutePath) {
IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(absolutePath));
switch(files.length) {
case 0:
return getExternalIFL(absolutePath);
case 1:
return getWorkspaceIFL(files[0]);
}
if (files.length==1) {
IFile file = files[0];
if (file.exists())
return getWorkspaceIFL(file);
} else {
Arrays.sort(files, new FILE_COMPARATOR());
final IProject preferredProject= cproject == null ? null : cproject.getProject();
IFile fileInCProject= null;
for (IFile file : files) {
if (file.exists()) {
// check for preferred project
final IProject project = file.getProject();
if (preferredProject != null && preferredProject.equals(project))
@ -140,10 +139,12 @@ public class IndexLocationFactory {
}
}
}
}
if (fileInCProject != null)
return getWorkspaceIFL(fileInCProject);
}
return getWorkspaceIFL(files[0]);
return getExternalIFL(absolutePath);
}
/**