mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Applied patch to fix 197634.
This commit is contained in:
parent
27bfb855d6
commit
e39c9dace5
1 changed files with 8 additions and 6 deletions
|
@ -49,12 +49,14 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
|
|||
|
||||
// The file is not already in the workspace so try to create an external translation unit for it.
|
||||
String projectName = getDirector().getLaunchConfiguration().getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
|
||||
ICProject project = CoreModel.getDefault().getCModel().getCProject(projectName);
|
||||
if (project != null)
|
||||
{
|
||||
IPath path = Path.fromOSString(file.getCanonicalPath());
|
||||
String id = CoreModel.getRegistedContentTypeId(project.getProject(), path.lastSegment());
|
||||
return new ExternalTranslationUnit[] { new ExternalTranslationUnit(project, new Path(file.getCanonicalPath()), id) };
|
||||
if (projectName != "") {
|
||||
ICProject project = CoreModel.getDefault().getCModel().getCProject(projectName);
|
||||
if (project != null)
|
||||
{
|
||||
IPath path = Path.fromOSString(file.getCanonicalPath());
|
||||
String id = CoreModel.getRegistedContentTypeId(project.getProject(), path.lastSegment());
|
||||
return new ExternalTranslationUnit[] { new ExternalTranslationUnit(project, new Path(file.getCanonicalPath()), id) };
|
||||
}
|
||||
}
|
||||
} catch (IOException e) { // ignore if getCanonicalPath throws
|
||||
} catch (CoreException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue