libstdc++-v3/ChangeLog:
PR libstdc++/96484
* src/c++17/fs_ops.cc (fs::read_symlink): Return an error
immediately for non-symlinks.
* src/filesystem/ops.cc (fs::read_symlink): Likewise.
ec.assign(errno, std::generic_category());
return result;
}
+ else if (!fs::is_symlink(make_file_status(st)))
+ {
+ ec.assign(EINVAL, std::generic_category());
+ return result;
+ }
+
std::string buf(st.st_size ? st.st_size + 1 : 128, '\0');
do
{
ec.assign(errno, std::generic_category());
return result;
}
+ else if (!fs::is_symlink(make_file_status(st)))
+ {
+ ec.assign(EINVAL, std::generic_category());
+ return result;
+ }
+
std::string buf(st.st_size ? st.st_size + 1 : 128, '\0');
do
{