diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2015-02-09 01:44:09 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2015-02-09 01:44:09 +0000 |
| commit | 12bd4897ff0678fa663e09d78ebc22dd255ceb86 (patch) | |
| tree | a8f4b3abea3e6937e60728991c736e6e3d322fc1 /source/DataFormatters/TypeSynthetic.cpp | |
| parent | 205afe679855a4ce8149cdaa94d3f0868ce796dc (diff) | |
Notes
Diffstat (limited to 'source/DataFormatters/TypeSynthetic.cpp')
| -rw-r--r-- | source/DataFormatters/TypeSynthetic.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/source/DataFormatters/TypeSynthetic.cpp b/source/DataFormatters/TypeSynthetic.cpp index 13c1c7508b68..b150b2bb6ee3 100644 --- a/source/DataFormatters/TypeSynthetic.cpp +++ b/source/DataFormatters/TypeSynthetic.cpp @@ -68,18 +68,24 @@ size_t TypeFilterImpl::FrontEnd::GetIndexOfChildWithName (const ConstString &name) { const char* name_cstr = name.GetCString(); - for (size_t i = 0; i < filter->GetCount(); i++) + if (name_cstr) { - const char* expr_cstr = filter->GetExpressionPathAtIndex(i); - if (expr_cstr) + for (size_t i = 0; i < filter->GetCount(); i++) { - if (*expr_cstr == '.') - expr_cstr++; - else if (*expr_cstr == '-' && *(expr_cstr+1) == '>') - expr_cstr += 2; + const char* expr_cstr = filter->GetExpressionPathAtIndex(i); + if (expr_cstr) + { + if (*expr_cstr == '.') + expr_cstr++; + else if (*expr_cstr == '-' && *(expr_cstr+1) == '>') + expr_cstr += 2; + } + if (expr_cstr) + { + if (!::strcmp(name_cstr, expr_cstr)) + return i; + } } - if (!::strcmp(name_cstr, expr_cstr)) - return i; } return UINT32_MAX; } |
