Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2008-03-30 23:52:09 +0000
committerSergey Prigogin2008-03-30 23:52:09 +0000
commitf03642cfb3f2673e96610756dd0e36269fb34aa2 (patch)
tree729deaac100d75c2c543c8844abf247d15473d65 /core/org.eclipse.cdt.core
parent56cf847c2a95c25ed5fdc3569005ee48124e83d3 (diff)
downloadorg.eclipse.cdt-f03642cfb3f2673e96610756dd0e36269fb34aa2.tar.gz
org.eclipse.cdt-f03642cfb3f2673e96610756dd0e36269fb34aa2.tar.xz
org.eclipse.cdt-f03642cfb3f2673e96610756dd0e36269fb34aa2.zip
Fixed bug 224817.
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/CPreprocessor.java17
1 files changed, 8 insertions, 9 deletions
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 68dcaa76f49..66ceb42ca42 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
@@ -9,11 +9,11 @@
* IBM - Initial API and implementation
* Anton Leherbauer (Wind River Systems)
* Markus Schorn (Wind River Systems)
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser.scanner;
import java.io.File;
-import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -757,14 +757,13 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
}
private int findIncludePos(String[] paths, File currentDirectory) {
- for (int i = 0; i < paths.length; ++i)
- try {
- String path = new File(paths[i]).getCanonicalPath();
- String parent = currentDirectory.getCanonicalPath();
- if (path.equals(parent))
- return i;
- } catch (IOException e) {
- }
+ for (int i = 0; i < paths.length; ++i) {
+ File pathDir = new File(paths[i]);
+ for (File dir = currentDirectory; dir != null; dir = dir.getParentFile()) {
+ if (dir.equals(pathDir))
+ return i;
+ }
+ }
return -1;
}

Back to the top