Fix data loss in PropertyFileIncluded

This commit is contained in:
wmayer
2013-05-06 08:27:25 +02:00
parent b198248535
commit 1aff25a62d
6 changed files with 140 additions and 90 deletions

View File

@@ -26,6 +26,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <algorithm>
# include <cassert>
# include <cstdio>
# include <cstdlib>
@@ -188,22 +189,13 @@ std::string FileInfo::getTempFileName(const char* FileName, const char* Path)
void FileInfo::setFile(const char* name)
{
std::string result;
const char *It=name;
while(*It != '\0') {
switch(*It)
{
case '\\':
result += "/";
break;
default:
result += *It;
}
It++;
if (!name) {
FileName.clear();
return;
}
FileName = result;
FileName = name;
std::replace(FileName.begin(), FileName.end(), '\\', '/');
}
std::string FileInfo::filePath () const