mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-12-17 21:58:13 +00:00
update frameworks/intl/src/utils.cpp.
Signed-off-by: wangkexin <wangkexin14@huawei.com>
This commit is contained in:
parent
4c33a1c441
commit
2d8f85e519
@ -224,12 +224,12 @@ bool IsDirExist(const char *path)
|
||||
if (!(path && *path)) {
|
||||
return false;
|
||||
}
|
||||
char resolved_path[PATH_MAX];
|
||||
if (realpath(path, resolved_path) == nullptr) {
|
||||
char* resolvedPath = new char[PATH_MAX];
|
||||
if (realpath(path, resolvedPath) == nullptr) {
|
||||
return false;
|
||||
}
|
||||
struct stat buf;
|
||||
return stat(resolved_path, &buf) == 0 && S_ISDIR(buf.st_mode);
|
||||
return stat(resolvedPath, &buf) == 0 && S_ISDIR(buf.st_mode);
|
||||
}
|
||||
|
||||
std::string trim(std::string &s)
|
||||
|
Loading…
Reference in New Issue
Block a user