diff --git a/filecomplete.cpp b/filecomplete.cpp index 83cbecc..0f33694 100644 --- a/filecomplete.cpp +++ b/filecomplete.cpp @@ -136,7 +136,7 @@ std::string file_predict(const char* data) } else { search_key = cur; } - if (cur.find("/") == std::string::npos && cur.find("\\") == std::string::npos) { + if (search_key.find("/") == std::string::npos && search_key.find("\\") == std::string::npos) { for (const auto& item : cur_work_content) { if (item != search_key && item.find(search_key) == 0) { return item.substr(search_key.size(), item.size() - search_key.size());