From 35daa1d3210e6f7e5c3b452d656475122c0ce13d Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Tue, 3 Jul 2012 16:40:59 -0400 Subject: [PATCH] PR 383941 - Support binaries with dots in their name. --- .../cdt/internal/core/model/CModelManager.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java index 28ccffca693..79b4c264882 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java @@ -662,16 +662,17 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang baseFileName = baseFileName.removeFileExtension(); ext = baseFileName.getFileExtension(); } while (ext != null && ext.length() > 0); - - boolean isBinary= false; final IContentTypeManager ctm = Platform.getContentTypeManager(); final IContentType ctbin = ctm.getContentType(CCorePlugin.CONTENT_TYPE_BINARYFILE); - final IContentType[] cts= ctm.findContentTypesFor(baseFileName.toString()); - for (int i=0; !isBinary && i < cts.length; i++) { - isBinary= cts[i].isKindOf(ctbin); - } - if (!isBinary) { - return null; + final IContentType[] cts = ctm.findContentTypesFor(baseFileName.toString()); + if (cts.length > 0) { + boolean isBinary= false; + for (int i=0; !isBinary && i < cts.length; i++) { + isBinary = cts[i].isKindOf(ctbin); + } + if (!isBinary) { + return null; + } } }