From 7e296c325a223a0f3ae9e1e6e4cc2131d8bdd15b Mon Sep 17 00:00:00 2001 From: iaom Date: Fri, 16 Jun 2023 09:27:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=87=E4=BB=B6=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=8E=A5=E5=8F=A3=E5=9C=A8=E4=BD=BF=E7=94=A8=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E6=90=9C=E7=B4=A2=E6=A0=B9=E7=9B=AE=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=90=9C=E5=88=B0=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsearch/searchinterface/searchtasks/file-search-task.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsearch/searchinterface/searchtasks/file-search-task.cpp b/libsearch/searchinterface/searchtasks/file-search-task.cpp index 3054630..84b7a18 100644 --- a/libsearch/searchinterface/searchtasks/file-search-task.cpp +++ b/libsearch/searchinterface/searchtasks/file-search-task.cpp @@ -365,7 +365,7 @@ bool FileSearchFilter::operator ()(const Xapian::Document &doc) const if (!m_parent->m_validDirectories.empty()) { inSearchDir = std::any_of(m_parent->m_validDirectories.begin(), m_parent->m_validDirectories.end(), [&](QString &dir) { //限制搜索在该目录下 - if (!path.startsWith(dir + "/")) { + if (dir != "/" && !path.startsWith(dir + "/")) { return false; }