Windows paths can use either separator.

This commit is contained in:
Pentarctagon 2022-07-02 13:42:15 -05:00
parent e613010b4b
commit a573e58007
No known key found for this signature in database
GPG key ID: 9456BC54A21DBFA0

View file

@ -214,15 +214,14 @@ std::string sanitize_log(const std::string& logstr)
#ifdef _WIN32
const char* user_name = getenv("USERNAME");
if(user_name != nullptr) {
boost::replace_all(str, std::string("\\") + user_name + "\\", "\\USER\\");
}
#else
const char* user_name = getenv("USER");
#endif
if(user_name != nullptr) {
boost::replace_all(str, std::string("/") + user_name + "/", "/USER/");
boost::replace_all(str, std::string("\\") + user_name + "\\", "\\USER\\");
}
#endif
return str;
}