mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Patch form ando
To deal with filesystem cases on windows.
This commit is contained in:
parent
506a17a722
commit
e56153c151
1 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue