diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-12-08 12:07:49 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-12-08 12:12:53 +0100 |
commit | 4c4999d944bbf8a34f8a320b8de6f4a325bd5d97 (patch) | |
tree | 346d254695a1650724cb0492ef2bbced17b35afc /helpcompiler/source/HelpCompiler.cxx | |
parent | de7018f755af0b2372c0e261f53d57de6cf77c38 (diff) |
tdf#96042: 'std::string::find("something") == 0' means "startsWith()".
This should fix a regression from 3bdd176731c351638f541a37b94094124f3c9f52,
apparently the cppcheck's advice is misleading.
Change-Id: I427ecaa1eb3c9841cb6112997b9b51feda4583d0
Diffstat (limited to 'helpcompiler/source/HelpCompiler.cxx')
-rw-r--r-- | helpcompiler/source/HelpCompiler.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx index 85a82d043bed..6d821e452b1a 100644 --- a/helpcompiler/source/HelpCompiler.cxx +++ b/helpcompiler/source/HelpCompiler.cxx @@ -334,7 +334,7 @@ void myparser::traverse( xmlNodePtr parentNode ) std::string hid; - if (branch.compare("hid") == 0) + if (branch.compare(0, 3, "hid") != 0) { size_t index = branch.find('/'); if (index != std::string::npos) @@ -492,7 +492,7 @@ bool HelpCompiler::compile() if ( !bExtensionMode && !fileName.empty()) { - if (fileName.compare("/text/") == 0) + if (fileName.compare(0, 6, "/text/") == 0) { int len = strlen("/text/"); actMod = fileName.substr(len); |