mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-12 03:37:53 +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::string indexed_content = Serialize(file);
|
||||||
std::ofstream cache;
|
WriteToFile(cache_basename + ".json", indexed_content);
|
||||||
cache.open(cache_basename + ".json");
|
|
||||||
assert(cache.good());
|
|
||||||
cache << indexed_content;
|
|
||||||
cache.close();
|
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,9 @@ void Fail(const std::string& message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WriteToFile(const std::string& filename, const std::string& content) {
|
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;
|
file << content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user