diff --git a/libsearch/searchinterface/searchtasks/file-content-search-task.cpp b/libsearch/searchinterface/searchtasks/file-content-search-task.cpp index 814907f..38d1fda 100644 --- a/libsearch/searchinterface/searchtasks/file-content-search-task.cpp +++ b/libsearch/searchinterface/searchtasks/file-content-search-task.cpp @@ -94,7 +94,7 @@ void FileContentSearchWorker::run() searchDirs.removeDuplicates(); for (QString &dir : searchDirs) { - if (dir.endsWith("/")) { + if (dir.endsWith("/") && dir != "/") { dir = dir.mid(0, dir.length() - 1); } diff --git a/libsearch/searchinterface/searchtasks/file-search-task.cpp b/libsearch/searchinterface/searchtasks/file-search-task.cpp index e068a63..c1fa75a 100644 --- a/libsearch/searchinterface/searchtasks/file-search-task.cpp +++ b/libsearch/searchinterface/searchtasks/file-search-task.cpp @@ -73,7 +73,7 @@ void FileSearchWorker::run() for (QString &dir : searchDirs) { if (QFileInfo::exists(dir)) { - if (dir.endsWith("/")) { + if (dir.endsWith("/") && dir != "/") { dir.remove(dir.length() - 1, 1); }