glocalfileinfo: Ensure boolean file attributes are set

Don’t just set them when they’re true and rely on their non-presence
being evaluated to `FALSE`. That means that they erroneously don’t get
returned in `g_file_info_list_attributes()`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2907
This commit is contained in:
Philip Withnall 2023-02-08 11:13:05 +00:00
parent 7082f03dbf
commit 728ad64b44

View File

@ -2024,6 +2024,8 @@ _g_local_file_info_get (const char *basename,
symlink_broken = TRUE;
}
}
else
g_file_info_set_is_symlink (info, FALSE);
if (stat_ok)
set_info_from_stat (info, &statbuf, attribute_matcher);
@ -2037,10 +2039,10 @@ _g_local_file_info_get (const char *basename,
if (_g_file_attribute_matcher_matches_id (attribute_matcher,
G_FILE_ATTRIBUTE_ID_STANDARD_IS_HIDDEN))
{
if (basename != NULL &&
(basename[0] == '.' ||
file_is_hidden (path, basename)))
g_file_info_set_is_hidden (info, TRUE);
g_file_info_set_is_hidden (info,
(basename != NULL &&
(basename[0] == '.' ||
file_is_hidden (path, basename))));
}
if (basename != NULL && basename[strlen (basename) -1] == '~' &&