mirror of https://gitee.com/makejava/EasyCode.git
修复保存路径与项目路径存在相同前缀时,导致保存位置发生错误。
This commit is contained in:
parent
25b74213af
commit
6c1e82d6e0
|
@ -97,6 +97,11 @@ public class SaveFile {
|
|||
// 路径对比,判断项目路径是否为文件保存路径的子路径
|
||||
String projectPath = handlerPath(baseDir.getPath());
|
||||
String tmpFilePath = handlerPath(this.path);
|
||||
if (tmpFilePath.length() > projectPath.length()) {
|
||||
if (!"/".equals(tmpFilePath.substring(projectPath.length(), projectPath.length() + 1))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return tmpFilePath.indexOf(projectPath) == 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue