Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Fix PR38915 from ando

Thanks to ando@xxxxxxxxxxxxxxx for the patch.



====================================================================
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.104
diff -u -r1.104 ChangeLog
--- ChangeLog	24 Jun 2003 04:13:26 -0000	1.104
+++ ChangeLog	24 Jun 2003 19:58:23 -0000
@@ -1,5 +1,13 @@
 2003-06-24 Alain Magloire
 
+	Patch form ando@xxxxxxxxxxxxxxx, to deal
+	with different file cases i.e. TEST.C vs test.c
+	On windows.
+	
+	* src/org/eclipse/cdt/core/ErrorParserManager.java
+
+2003-06-24 Alain Magloire
+
 	* src/org/eclipse/cdt/internal/errorparser/GCCErrorParser.java:
 	New scheme to detect, preprocessor errors.
 	* src/org/eclipse/cdt/core/ErrorParserManager.java:
Index: src/org/eclipse/cdt/core/ErrorParserManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java,v
retrieving revision 1.11
diff -u -r1.11 ErrorParserManager.java
--- src/org/eclipse/cdt/core/ErrorParserManager.java	24 Jun 2003 04:12:55 -0000	1.11
+++ src/org/eclipse/cdt/core/ErrorParserManager.java	24 Jun 2003 19:58:23 -0000
@@ -5,6 +5,7 @@
  * All Rights Reserved.
  */
 
+import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.ArrayList;
@@ -255,6 +256,20 @@
 		try {
 			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;
 	}



Back to the top