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/automem.cxx | |
parent | 33cbc99fea5a3e4b87e883fd60ec97d4503109f3 (diff) |
Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
Diffstat (limited to 'compilerplugins/clang/automem.cxx')
-rw-r--r-- | compilerplugins/clang/automem.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compilerplugins/clang/automem.cxx b/compilerplugins/clang/automem.cxx index 1b49d13cb097..3aa671fef1b5 100644 --- a/compilerplugins/clang/automem.cxx +++ b/compilerplugins/clang/automem.cxx @@ -52,11 +52,11 @@ bool AutoMem::VisitCXXDeleteExpr(const CXXDeleteExpr* expr) if (ignoreLocation( expr )) return true; StringRef aFileName = compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(expr->getLocStart())); - if (aFileName.startswith(SRCDIR "/include/salhelper/") - || aFileName.startswith(SRCDIR "/include/osl/") - || aFileName.startswith(SRCDIR "/salhelper/") - || aFileName.startswith(SRCDIR "/store/") - || aFileName.startswith(SRCDIR "/sal/")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/salhelper/") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/osl/") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/salhelper/") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/store/") + || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sal/")) return true; if (mbInsideDestructor) |