mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 16:31:39 +00:00
Call p_readlink to determine symlink size
This commit is contained in:
parent
fb60d268df
commit
94ed23f86a
@ -99,6 +99,19 @@ static int do_lstat(
|
|||||||
buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
|
buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
|
||||||
buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
|
buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
|
||||||
buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
|
buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
|
||||||
|
|
||||||
|
if (fMode & S_IFLNK)
|
||||||
|
{
|
||||||
|
char target[GIT_WIN_PATH];
|
||||||
|
int readlink_result;
|
||||||
|
|
||||||
|
readlink_result = p_readlink(file_name, target, GIT_WIN_PATH);
|
||||||
|
|
||||||
|
if (readlink_result)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
buf->st_size = strnlen(target, GIT_WIN_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user