From b730f979801ba1fc19a3acfb3e3e3264e46dc22d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Oct 2011 11:28:07 +0200 Subject: Implement more robust profile path parsing --- odb/odb.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/odb/odb.cxx b/odb/odb.cxx index a4376b5..cdc1513 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -927,13 +927,24 @@ profile_paths (strings const& sargs, char const* name) { case read_prefix: { - if (line == "#include <...> search starts here:") + // The English string that we are looking for is "#include <...> + // search starts here:" but it can be translated. However, all + // the translations seems to have the "#include" and "<...>" + // parts, so we can search for those. + // + if (line.find ("#include") != string::npos && + line.find ("<...>") != string::npos) state = read_path; break; } case read_path: { - if (line == "End of search list.") + // The end of the list is terminated with the "End of search + // list." line, which, again, can be translated. Here we don't + // have any invariable parts that we can use. Instead, we will + // rely on the fact that all the paths are space-indented. + // + if (!line.empty () && line[0] != ' ') state = read_suffix; else // Paths are indented with a space. -- cgit v1.1