Fixed files with backslashes not reporting any items

Parse_linemarker was turning double backslashes into quadruple backslashes.
Making it instead turn them into single backslashes makes the `lm.value().file == path` comparison true in preprocess() so that p.enable_write() is called.

Fixes #106.
This commit is contained in:
John 2022-05-30 14:22:38 -07:00 • committed by Jonathan Müller
commit b958847850

View file

@ -1030,10 +1030,13 @@ ts::optional<linemarker> parse_linemarker(position& p)
p.skip(); p.skip();
std::string file_name; std::string file_name;
for (; !starts_with(p, "\""); p.skip()) for (; !starts_with(p, R"(")"); p.skip())
{ {
if (*p.ptr() == '\\') if (starts_with(p, R"(\\)"))
file_name += "\\\\"; {
file_name += R"(\)";
p.skip();
}
else else
file_name += *p.ptr(); file_name += *p.ptr();
} }