diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-05-18 09:56:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-05-18 09:56:01 +0200 |
commit | df8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d (patch) | |
tree | ea5daefc9c1665ab14aeeedc0de4298c7c85a8b1 /compilerplugins/clang/constparams.cxx | |
parent | 33cbc99fea5a3e4b87e883fd60ec97d4503109f3 (diff) |
Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
Diffstat (limited to 'compilerplugins/clang/constparams.cxx')
-rw-r--r-- | compilerplugins/clang/constparams.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx index 52f1ffe12e19..ad5549d02263 100644 --- a/compilerplugins/clang/constparams.cxx +++ b/compilerplugins/clang/constparams.cxx @@ -94,16 +94,16 @@ bool ConstParams::VisitFunctionDecl(FunctionDecl * functionDecl) } StringRef aFileName = getFilename(functionDecl->getLocStart()); - if (aFileName.startswith(SRCDIR "/sal/") - || aFileName.startswith(SRCDIR "/bridges/") - || aFileName.startswith(SRCDIR "/binaryurp/") - || aFileName.startswith(SRCDIR "/stoc/") - || aFileName.startswith(WORKDIR "/YaccTarget/unoidl/source/sourceprovider-parser.cxx") + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sal/") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/bridges/") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/binaryurp/") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/stoc/") + || loplugin::hasPathnamePrefix(aFileName, WORKDIR "/YaccTarget/unoidl/source/sourceprovider-parser.cxx") // some weird calling through a function pointer - || aFileName.startswith(SRCDIR "/svtools/source/table/defaultinputhandler.cxx") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/svtools/source/table/defaultinputhandler.cxx") // windows only - || aFileName.startswith(SRCDIR "/basic/source/sbx/sbxdec.cxx") - || aFileName.startswith(SRCDIR "/sfx2/source/doc/syspath.cxx")) { + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/basic/source/sbx/sbxdec.cxx") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sfx2/source/doc/syspath.cxx")) { return true; } |