glocalfileinfo: Use stat results only if stat succeeded

This commit is contained in:
Luca Bacci 2024-03-06 18:25:15 +01:00 committed by Philip Withnall
parent 3ae88886ac
commit 2cf0ce39aa

View File

@ -2021,11 +2021,14 @@ _g_local_file_info_get (const char *basename,
_g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_IS_SYSTEM,
(statbuf.attributes & FILE_ATTRIBUTE_SYSTEM));
_g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_IS_MOUNTPOINT,
(statbuf.reparse_tag == IO_REPARSE_TAG_MOUNT_POINT));
if (stat_ok)
{
_g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_IS_MOUNTPOINT,
(statbuf.reparse_tag == IO_REPARSE_TAG_MOUNT_POINT));
if (statbuf.reparse_tag != 0)
_g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_REPARSE_POINT_TAG, statbuf.reparse_tag);
if (statbuf.reparse_tag != 0)
_g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_REPARSE_POINT_TAG, statbuf.reparse_tag);
}
#endif
symlink_target = NULL;