From e56153c151172a6def55046ee7c0207faba9ae34 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Tue, 24 Jun 2003 19:59:12 +0000 Subject: [PATCH] Patch form ando To deal with filesystem cases on windows. --- .../org/eclipse/cdt/core/ErrorParserManager.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java index 70905c5578d..388aa4d526c 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java @@ -5,6 +5,7 @@ package org.eclipse.cdt.core; * All Rights Reserved. */ +import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; @@ -256,6 +257,20 @@ public class ErrorParserManager extends OutputStream { file = (path.isAbsolute()) ? fProject.getWorkspace().getRoot().getFileForLocation(path) : fProject.getFile(path); } catch (Exception e) { } + + // We have to do another try, on Windows for cases like "TEST.C" vs "test.c" + // We use the java.io.File canonical path. + if (file == null || !file.exists()) { + File f = path.toFile(); + try { + String canon = f.getCanonicalPath(); + path = new Path(canon); + file = (path.isAbsolute()) ? fProject.getWorkspace().getRoot().getFileForLocation(path) : fProject.getFile(path); + } catch (IOException e1) { + } + } else { + return file; + } return (file != null && file.exists()) ? file : null; }