diff options
author | Tony Cook <tony@develop-help.com> | 2022-11-11 09:55:59 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2023-01-10 09:49:56 +1100 |
commit | 8c61f504eeb90faedc416b9377bd478d8c3b19a2 (patch) | |
tree | 3127e66ae93908e82fa8e71434a131e1714f3b61 /t/win32 | |
parent | 6f9328ca348b95ff60b2672e0c425242e6e87419 (diff) | |
download | perl-8c61f504eeb90faedc416b9377bd478d8c3b19a2.tar.gz |
make win32_lstat() return the length of the link in st_size
This is reflected in the result of lstat() in perl.
This matches POSIX behaviour.
Fixed #20476
Diffstat (limited to 't/win32')
-rw-r--r-- | t/win32/stat.t | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/t/win32/stat.t b/t/win32/stat.t index 7fa143750f..f36411f798 100644 --- a/t/win32/stat.t +++ b/t/win32/stat.t @@ -105,6 +105,9 @@ if (system("mklink $tmpfile1 win32\\stat.t") == 0) { # our hard link no longer exists, check that is reflected in nlink is($st[3], $nlink-1, "check nlink updated"); + is((lstat($tmpfile1))[7], length(readlink($tmpfile1)), + "check size matches length of link"); + unlink($tmpfile1); } @@ -129,6 +132,10 @@ if (system("mklink /d $tmpfile1 win32") == 0) { if (system("mklink /j $tmpfile1 win32") == 0) { ok(-l $tmpfile1, "lstat sees a symlink on the directory junction"); + my @st = lstat($tmpfile1); + is($st[7], length(readlink($tmpfile1)), + "check returned length matches POSIX"); + rmdir( $tmpfile1 ); } |