aboutsummaryrefslogtreecommitdiff
path: root/odb/odb.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-10-19 07:32:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-10-21 19:25:06 +0200
commit2d1702ccf69d152bf864c5cf5375b6c0d442b9f0 (patch)
tree39cd11646aaf0411de28685db93e6387c5239231 /odb/odb.cxx
parent6508eb18a20a2f0bc48374f3f0a352f1195cc95b (diff)
Implement more robust profile path parsing
Diffstat (limited to 'odb/odb.cxx')
-rw-r--r--odb/odb.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/odb/odb.cxx b/odb/odb.cxx
index 51c14f4..fd61e95 100644
--- a/odb/odb.cxx
+++ b/odb/odb.cxx
@@ -928,13 +928,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.