mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 09:50:26 +00:00
Write cache to disk in binary format. Otherwise some escaping may occur.
This commit is contained in:
parent
0c839d19fc
commit
22ef88045f
@ -136,9 +136,5 @@ void WriteToCache(Config* config, IndexFile& file) {
|
||||
}
|
||||
|
||||
std::string indexed_content = Serialize(file);
|
||||
std::ofstream cache;
|
||||
cache.open(cache_basename + ".json");
|
||||
assert(cache.good());
|
||||
cache << indexed_content;
|
||||
cache.close();
|
||||
WriteToFile(cache_basename + ".json", indexed_content);
|
||||
}
|
||||
|
@ -462,7 +462,9 @@ void Fail(const std::string& message) {
|
||||
}
|
||||
|
||||
void WriteToFile(const std::string& filename, const std::string& content) {
|
||||
std::ofstream file(filename);
|
||||
std::ofstream file(filename,
|
||||
std::ios::out | std::ios::trunc | std::ios::binary);
|
||||
assert(file.good());
|
||||
file << content;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user