summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/includeform.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/compilerplugins/clang/includeform.cxx b/compilerplugins/clang/includeform.cxx
index becc1c028c3c..284b7dadccff 100644
--- a/compilerplugins/clang/includeform.cxx
+++ b/compilerplugins/clang/includeform.cxx
@@ -52,6 +52,8 @@ private:
|| loplugin::hasPathnamePrefix(
SearchPath, WORKDIR "/UnpackedTarball"));
} else {
+ auto dir1 = std::string(SearchPath);
+ loplugin::normalizeDotDotInFilePath(dir1);
auto const file = StringRef(
compiler.getSourceManager().getPresumedLoc(HashLoc)
.getFilename());
@@ -64,9 +66,9 @@ private:
pos = pos2;
}
#endif
- auto dir = std::string(compat::take_front(file, pos));
- loplugin::normalizeDotDotInFilePath(dir);
- shouldUseAngles = !loplugin::isSamePathname(SearchPath, dir);
+ auto dir2 = std::string(compat::take_front(file, pos));
+ loplugin::normalizeDotDotInFilePath(dir2);
+ shouldUseAngles = !loplugin::isSamePathname(dir1, dir2);
}
if (shouldUseAngles == IsAngled) {
return;