fix crasher in config unit tests
authorCraig Dowell <craigdo@ee.washington.edu>
Tue Jan 20 21:16:52 2009 -0800 (12 months ago)
changeset 41437f7823a31f77
parent 4142 59f784af5db6
child 4144 c59fdf82869b
fix crasher in config unit tests
src/core/config.cc
     1.1 --- a/src/core/config.cc	Tue Jan 20 18:56:33 2009 -0800
     1.2 +++ b/src/core/config.cc	Tue Jan 20 21:16:52 2009 -0800
     1.3 @@ -287,9 +287,21 @@
     1.4    tmp = path.find ("/");
     1.5    NS_ASSERT (tmp == 0);
     1.6    std::string::size_type next = path.find ("/", 1);
     1.7 +
     1.8    if (next == std::string::npos)
     1.9      {
    1.10 -      DoResolveOne (root);
    1.11 +      //
    1.12 +      // If root is zero, we're beginning to see if we can use the object name 
    1.13 +      // service to resolve this path.  It is impossible to have a object name 
    1.14 +      // associated with the root of the object name service since that root
    1.15 +      // is not an object.  This path must be referring to something in another
    1.16 +      // namespace and it will have been found already since the name service
    1.17 +      // is always consulted last.
    1.18 +      // 
    1.19 +      if (root)
    1.20 +        {
    1.21 +          DoResolveOne (root);
    1.22 +        }
    1.23        return;
    1.24      }
    1.25    std::string item = path.substr (1, next-1);