Ignore VS2015 files.

Improve parsing resources.ini (Added chec on BOM signatures)
This commit is contained in:
s1lent 2017-01-29 22:07:35 +07:00 committed by s1lentq
parent a5fc34007d
commit 4727659db0
3 changed files with 28 additions and 9 deletions

3
.gitignore vendored
View File

@ -6,7 +6,10 @@
**/msvc/*.opensdf
**/msvc/*.user
**/msvc/*.suo
**/msvc/*.db
**/msvc/*.opendb
**/msvc/*.aps
**/msvc/.vs
**/msvc/ipch
**/PublishPath*.txt
**/Server*.bat

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -213,13 +213,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View File

@ -192,13 +192,25 @@ void CResourceFile::Log(flag_type_log type, const char *fmt, ...)
fclose(fp);
}
#ifdef CreateDirectory
#undef CreateDirectory
#endif
void CreateDirectory(const char *path)
{
_mkdir(path
#ifndef _WIN32
,0755
#endif // _WIN32
);
#ifdef _WIN32
DWORD attr = ::GetFileAttributesA(path);
if (attr == INVALID_FILE_ATTRIBUTES || (~attr & FILE_ATTRIBUTE_DIRECTORY))
{
_mkdir(path);
}
#else
struct stat s;
if (stat(path, &s) != 0 || !S_ISDIR(s.st_mode))
{
_mkdir(path, 0755);
}
#endif
}
void CResourceFile::Init()
@ -319,7 +331,11 @@ void CResourceFile::LoadResources()
while (!feof(fp) && fgets(line, sizeof(line), fp))
{
pos = line;
// skip bytes BOM signature
if ((byte)line[0] == 0xEFu && (byte)line[1] == 0xBBu && (byte)line[2] == 0xBFu)
pos = &line[3];
else
pos = line;
cline++;