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:
parent
4d82e37078
commit
bcbcee87d5
|
@ -59,13 +59,13 @@ bool Library::load(const char exename[], const char path[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// open file..
|
// open file..
|
||||||
FILE *fp = fopen(path, "rt");
|
FILE *fp = fopen(path, "rb");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
// failed to open file.. is there no extension?
|
// failed to open file.. is there no extension?
|
||||||
std::string fullfilename(path);
|
std::string fullfilename(path);
|
||||||
if (Path::getFilenameExtension(fullfilename) == "") {
|
if (Path::getFilenameExtension(fullfilename) == "") {
|
||||||
fullfilename += ".cfg";
|
fullfilename += ".cfg";
|
||||||
fp = fopen(fullfilename.c_str(), "rt");
|
fp = fopen(fullfilename.c_str(), "rb");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp==NULL) {
|
if (fp==NULL) {
|
||||||
|
@ -74,7 +74,7 @@ bool Library::load(const char exename[], const char path[])
|
||||||
std::replace(temp.begin(), temp.end(), '\\', '/');
|
std::replace(temp.begin(), temp.end(), '\\', '/');
|
||||||
const std::string installfolder = Path::getPathFromFilename(temp);
|
const std::string installfolder = Path::getPathFromFilename(temp);
|
||||||
const std::string filename = installfolder + "cfg/" + fullfilename;
|
const std::string filename = installfolder + "cfg/" + fullfilename;
|
||||||
fp = fopen(filename.c_str(), "rt");
|
fp = fopen(filename.c_str(), "rb");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
|
|
Loading…
Reference in New Issue