From 24ce30003a16cdb3ddfbd0c07db80be143bc30dc Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 15 Jun 2020 11:07:31 +0200 Subject: [PATCH] Slightly improved search for included header file --- src/source_clang.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/source_clang.cpp b/src/source_clang.cpp index beb791a..f718401 100644 --- a/src/source_clang.cpp +++ b/src/source_clang.cpp @@ -1232,7 +1232,8 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file if(static_cast(source_location.get_offset().line) - 1 <= client_data->line_nr && filesystem::get_normal_path(source_location.get_path()) == client_data->file_path) { auto included_file_str = clangmm::to_string(clang_getFileName(included_file)); - if(ends_with(included_file_str, client_data->sm_str)) { + if(ends_with(included_file_str, client_data->sm_str) && + boost::filesystem::path(included_file_str).filename() == boost::filesystem::path(client_data->sm_str).filename()) { client_data->found_include = included_file_str; break; }