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

Avoid unwanted conversion from a UNIX path to c:\ on Windows, just as with 297781

This commit is contained in:
John Cortell 2009-12-15 00:18:34 +00:00
parent bbf22bce99
commit cdd0c897ac

View file

@ -37,6 +37,7 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
import org.eclipse.cdt.internal.core.util.MementoTokenizer;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
@ -339,8 +340,16 @@ public class Binary extends Openable implements IBinary {
TranslationUnit tu;
if (wkspFile != null)
tu = new TranslationUnit(this, wkspFile, id);
else
tu = new ExternalTranslationUnit(this, Path.fromOSString(filename), id);
else {
IPath path = Path.fromOSString(filename);
if (path.toFile().exists()) {
tu = new ExternalTranslationUnit(this, path, id);
}
else {
// filename may be a UNIX path; don't convert to c:\ on Windows.
tu = new ExternalTranslationUnit(this, URIUtil.toURI(filename), id);
}
}
if (! info.includesChild(tu))
info.addChild(tu);