The test case was a bit tricky because creating symlinks on Windows generally requires that the process is elevated, or that "Developer Mode" is enabled, which is why I chose to skip the test if the symlink was not created successfully.
I've tested these changes under MSYS2 (UCRT64) and Ubuntu 22.04 (WSL). The test case already passes on Ubuntu if executed against master. Only the Windows implementation required changes to report the file sizes of symlink targets.
Disclaimer: I don't program in C, so please cut me some slack.
I'm not sure about the usage of
_fileno
, as I've seen a couple of comments in other parts of the source claiming that it was incompatible withgcc -ansi
. However, it's already used inhash_print.c
: https://github.com/rhash/RHash/blob/eb536fa8f40074b6881ca00e7fd775a7ae814a41/hash_print.c#L506-L510The test case was a bit tricky because creating symlinks on Windows generally requires that the process is elevated, or that "Developer Mode" is enabled, which is why I chose to skip the test if the symlink was not created successfully.
I've tested these changes under MSYS2 (UCRT64) and Ubuntu 22.04 (WSL). The test case already passes on Ubuntu if executed against master. Only the Windows implementation required changes to report the file sizes of symlink targets.