diff --git a/interfaces/innerkits/native/file_share/src/file_share.cpp b/interfaces/innerkits/native/file_share/src/file_share.cpp index 3f26a933de29c9c4e4c7ffdd8e58d02d09644d89..5dd2008f3aa8cc61b2f255bbde9a0d464e3a1dba 100644 --- a/interfaces/innerkits/native/file_share/src/file_share.cpp +++ b/interfaces/innerkits/native/file_share/src/file_share.cpp @@ -252,9 +252,16 @@ static bool CheckIsMountPoint(const string &path) return false; } + string encodePath = path; + size_t pos = encodePath.find(" "); + while (pos != string::npos) { + encodePath.replace(pos, 1, "\\040"); + pos = encodePath.find(" ", pos + 1); + } + string tmpLine; while (std::getline(inputStream, tmpLine)) { - if (tmpLine.find(path) != std::string::npos) { + if (tmpLine.find(encodePath) != std::string::npos) { inputStream.close(); return true; }