Commit 666255e0 authored by Philip Trettner's avatar Philip Trettner

Merge branch 'escape-windows-paths' into 'master'

Escape windows path backslashes in JSON output

See merge request !1
parents e82f8872 5f4d8d05
......@@ -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