[6875] Skip utf8 header (if exist) for mangosd.conf file

This commit is contained in:
DiSlord 2008-12-06 02:44:39 +03:00
parent d3b4b341a0
commit 2907868b80
2 changed files with 6 additions and 1 deletions

View file

@ -340,6 +340,11 @@ int DOTCONFDocument::setContent(const char * _fileName)
error(0, NULL, "failed to open file '%s': %s", fileName, strerror(errno)); error(0, NULL, "failed to open file '%s': %s", fileName, strerror(errno));
return -1; return -1;
} }
// Try read utf8 header and skip it if exist
uint32 utf8header = 0;
fgets((char*)&utf8header, 4, file); // Try read header
if (utf8header!=0x00BFBBEF) // If not exist
fseek(file, 0, SEEK_SET); // Reset read position
ret = parseFile(); ret = parseFile();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "6874" #define REVISION_NR "6875"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__