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:
parent
bbf22bce99
commit
cdd0c897ac
1 changed files with 11 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue