(Windows) Log output hack to indiscriminately replace forward slashes with backslashes.

This commit is contained in:
Leon Styhre 2021-01-24 11:50:53 +01:00
parent d1bee1c256
commit 38b30bf353

View file

@ -91,7 +91,16 @@ Log::~Log()
return;
}
#if defined(_WIN64)
// This is really a hack as it will not only replace forward slashes for filenames but
// for any string that contains this character. But it's probably still better than doing
// nothing and it's unlikely to be worth the effort to implement proper string replacements
// at all the locations that would otherwise be required.
std::string formattedString = Utils::String::replace(os.str(), "/", "\\");
file << formattedString;
#else
file << os.str();
#endif
// If it's an error, also print to console.
// Print all messages if using --debug.