Library: Changed 'rt' to 'rb' when open files. TinyXml won't choke on CRLF in Windows then. Thanks sam-truscott for telling me this.

This commit is contained in:
Daniel Marjamäki 2013-09-13 07:26:52 +02:00
parent 4d82e37078
commit bcbcee87d5
1 changed files with 3 additions and 3 deletions

View File

@ -59,13 +59,13 @@ bool Library::load(const char exename[], const char path[])
}
// open file..
FILE *fp = fopen(path, "rt");
FILE *fp = fopen(path, "rb");
if (fp == NULL) {
// failed to open file.. is there no extension?
std::string fullfilename(path);
if (Path::getFilenameExtension(fullfilename) == "") {
fullfilename += ".cfg";
fp = fopen(fullfilename.c_str(), "rt");
fp = fopen(fullfilename.c_str(), "rb");
}
if (fp==NULL) {
@ -74,7 +74,7 @@ bool Library::load(const char exename[], const char path[])
std::replace(temp.begin(), temp.end(), '\\', '/');
const std::string installfolder = Path::getPathFromFilename(temp);
const std::string filename = installfolder + "cfg/" + fullfilename;
fp = fopen(filename.c_str(), "rt");
fp = fopen(filename.c_str(), "rb");
}
if (fp == NULL)