readlink失败返回原字符串
This commit is contained in:
parent
594901065c
commit
2c0bc48e20
|
@ -297,7 +297,7 @@ extern "C"
|
||||||
char path[256] = { 0 };
|
char path[256] = { 0 };
|
||||||
int len = readlink(lnk, path, sizeof(path) - 1);
|
int len = readlink(lnk, path, sizeof(path) - 1);
|
||||||
|
|
||||||
return path;
|
return len > 0 ? path : lnk;
|
||||||
}
|
}
|
||||||
static int enum_files(const char* dir, bool recursive, bool(*found_file)(const char* path_file, void* param), void* param)
|
static int enum_files(const char* dir, bool recursive, bool(*found_file)(const char* path_file, void* param), void* param)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue