mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
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:
parent
7082f03dbf
commit
728ad64b44
@ -2024,6 +2024,8 @@ _g_local_file_info_get (const char *basename,
|
|||||||
symlink_broken = TRUE;
|
symlink_broken = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
g_file_info_set_is_symlink (info, FALSE);
|
||||||
|
|
||||||
if (stat_ok)
|
if (stat_ok)
|
||||||
set_info_from_stat (info, &statbuf, attribute_matcher);
|
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,
|
if (_g_file_attribute_matcher_matches_id (attribute_matcher,
|
||||||
G_FILE_ATTRIBUTE_ID_STANDARD_IS_HIDDEN))
|
G_FILE_ATTRIBUTE_ID_STANDARD_IS_HIDDEN))
|
||||||
{
|
{
|
||||||
if (basename != NULL &&
|
g_file_info_set_is_hidden (info,
|
||||||
|
(basename != NULL &&
|
||||||
(basename[0] == '.' ||
|
(basename[0] == '.' ||
|
||||||
file_is_hidden (path, basename)))
|
file_is_hidden (path, basename))));
|
||||||
g_file_info_set_is_hidden (info, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (basename != NULL && basename[strlen (basename) -1] == '~' &&
|
if (basename != NULL && basename[strlen (basename) -1] == '~' &&
|
||||||
|
Loading…
Reference in New Issue
Block a user