Use @ as escape character of cache filenames

Fixes #112
This commit is contained in:
Fangrui Song 2018-01-10 23:32:36 -08:00 committed by Jacob Dufault
parent 27ddce4cd6
commit 6fb1798692

View File

@ -224,9 +224,9 @@ void EnsureEndsInSlash(std::string& path) {
std::string EscapeFileName(std::string path) { std::string EscapeFileName(std::string path) {
if (path.size() && path.back() == '/') if (path.size() && path.back() == '/')
path.pop_back(); path.pop_back();
std::replace(path.begin(), path.end(), '\\', '_'); std::replace(path.begin(), path.end(), '\\', '@');
std::replace(path.begin(), path.end(), '/', '_'); std::replace(path.begin(), path.end(), '/', '@');
std::replace(path.begin(), path.end(), ':', '_'); std::replace(path.begin(), path.end(), ':', '@');
return path; return path;
} }