diff options
author | Matt Spinler <spinler@us.ibm.com> | 2018-09-25 16:23:13 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2018-10-02 16:43:29 -0500 |
commit | ea6516c4fe95b9d7f140f108c621c24a956ad98b (patch) | |
tree | 6494d78d8f149382bab7d62af0f8905fb06f9e03 | |
parent | 59cbf3461a761968cc6f9f93bb0d4efaaf17ecbe (diff) | |
download | phosphor-objmgr-ea6516c4fe95b9d7f140f108c621c24a956ad98b.tar.gz phosphor-objmgr-ea6516c4fe95b9d7f140f108c621c24a956ad98b.zip |
Don't return the input path in GetAncestors
If '/A/B/C' is passed in as the path argument into GetAncestors,
don't return /A/B/C, but only its actual ancestors /A and /A/B.
Change-Id: I8dde80fa2ae5fad26c93be5fda5cfda9ff1b77d8
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r-- | src/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 1d4a7c4..ef93cc3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -849,7 +849,8 @@ int main(int argc, char** argv) for (auto& object_path : interface_map) { auto& this_path = object_path.first; - if (boost::starts_with(req_path, this_path)) + if (boost::starts_with(req_path, this_path) && + (req_path != this_path)) { if (interfaces.empty()) { |