Commit 5f4d8d05 authored by Jonathan Kunstwald's avatar Jonathan Kunstwald

Escape windows path backslashes in JSON output

parent e82f8872
......@@ -155,7 +155,9 @@ void write_speedscope_json(std::string const &filename)
out << ",";
out << "{";
out << "\"name\":\"" << (std::string(loc->name).empty() ? beautify_function_name(loc->function) : loc->name) << "\",";
out << "\"file\":\"" << loc->file << "\",";
std::string escapedFilePath = loc->file;
std::replace(escapedFilePath.begin(), escapedFilePath.end(), '\\', '/');
out << "\"file\":\"" << escapedFilePath << "\",";
out << "\"line\":" << loc->line << "";
out << "}";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment