mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-20 03:50:13 -04:00
!109 【Openharmony-3.2-release】输入参数校验路径是否存在
Merge pull request !109 from fyz1019/OpenHarmony-3.2-Release
This commit is contained in:
+7
-1
@@ -179,7 +179,7 @@ string FileEntry::RealPath(const string &path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
char buffer[MAX_PATH];
|
||||
if (!PathCanonicalize(buffer, AdapateLongPath(path).c_str())) {
|
||||
if (!PathCanonicalize(buffer, path.c_str())) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -193,6 +193,9 @@ string FileEntry::RealPath(const string &path)
|
||||
if (!PathCombine(temp, current, buffer)) {
|
||||
return "";
|
||||
}
|
||||
if (!Exist(string(temp))) {
|
||||
return "";
|
||||
}
|
||||
return string(temp);
|
||||
}
|
||||
#else
|
||||
@@ -201,6 +204,9 @@ string FileEntry::RealPath(const string &path)
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
if (!Exist(string(buffer))) {
|
||||
return "";
|
||||
}
|
||||
return string(buffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user