aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-10-19 11:28:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-10-19 11:28:07 +0200
commitb730f979801ba1fc19a3acfb3e3e3264e46dc22d (patch)
tree13d9e8faea3a8430d4991d7732eb6306af9f857f
parentcae930dc00b603db04a8b9ef3627e69591d650d7 (diff)
Implement more robust profile path parsing
-rw-r--r--odb/odb.cxx15
1 files 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.