Merge branch 'wip/oholy/is-backup-false' into 'main'

glocalfileinfo: Ensure that is-backup is always set

See merge request GNOME/glib!3311
This commit is contained in:
Philip Withnall 2023-03-06 17:41:35 +00:00
commit 335d3a4c04

View File

@ -2049,9 +2049,10 @@ _g_local_file_info_get (const char *basename,
file_is_hidden (path, basename)))); file_is_hidden (path, basename))));
} }
if (basename != NULL && basename[strlen (basename) -1] == '~' && _g_file_info_set_attribute_boolean_by_id (info,
(stat_ok && S_ISREG (_g_stat_mode (&statbuf)))) G_FILE_ATTRIBUTE_ID_STANDARD_IS_BACKUP,
_g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_STANDARD_IS_BACKUP, TRUE); basename != NULL && basename[strlen (basename) - 1] == '~' &&
(stat_ok && S_ISREG (_g_stat_mode (&statbuf))));
#else #else
if (statbuf.attributes & FILE_ATTRIBUTE_HIDDEN) if (statbuf.attributes & FILE_ATTRIBUTE_HIDDEN)
g_file_info_set_is_hidden (info, TRUE); g_file_info_set_is_hidden (info, TRUE);
@ -2067,6 +2068,8 @@ _g_local_file_info_get (const char *basename,
if (statbuf.reparse_tag != 0) 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); _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_DOS_REPARSE_POINT_TAG, statbuf.reparse_tag);
_g_file_info_set_attribute_boolean_by_id (info, G_FILE_ATTRIBUTE_ID_STANDARD_IS_BACKUP, FALSE);
#endif #endif
symlink_target = NULL; symlink_target = NULL;