Index: sakura_core/env/CDocTypeManager.cpp =================================================================== --- sakura_core/env/CDocTypeManager.cpp (リビジョン 44938) +++ sakura_core/env/CDocTypeManager.cpp (リビジョン 46423) @@ -15,16 +15,15 @@ */ CTypeConfig CDocTypeManager::GetDocumentTypeOfPath( const TCHAR* pszFilePath ) { - TCHAR szExt[_MAX_EXT]; - - if( NULL != pszFilePath && 0 < (int)_tcslen( pszFilePath ) ){ - _tsplitpath( pszFilePath, NULL, NULL, NULL, szExt ); - if( szExt[0] == _T('.') ) - return GetDocumentTypeOfExt( szExt + 1 ); - else - return GetDocumentTypeOfExt( szExt ); + if( ! pszFilePath || ! pszFilePath[0] ) { + return CTypeConfig(0); } - return CTypeConfig(0); + + TCHAR szExt[_MAX_EXT] = _T(""), + szFileName[_MAX_FNAME] = _T(""); + _tsplitpath( pszFilePath, NULL, NULL, szFileName, szExt ); + return szExt[0] ? GetDocumentTypeOfExt( szExt[0] == _T('.') ? szExt + 1 : szExt ) + : GetDocumentTypeOfExt( szFileName ); }