summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2023-02-08 10:28:35 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2023-02-08 11:58:15 +0000
commit7082f03dbf31ba190d061d154d683c57d91db3ce (patch)
tree3a4beea2b44f9d71789b45ee37daa58f8086f001
parented8e86a7d41a0900d8fa57edc64264d04cf8135b (diff)
downloadglib-7082f03dbf31ba190d061d154d683c57d91db3ce.tar.gz
gio-tool-info: Add missing attribute check
`g_file_info_get_is_hidden()` should not be called without checking the attribute is set first, just as with the calls higher up in this code. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2907
-rw-r--r--gio/gio-tool-info.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gio/gio-tool-info.c b/gio/gio-tool-info.c
index c992a6f02..d51edb47b 100644
--- a/gio/gio-tool-info.c
+++ b/gio/gio-tool-info.c
@@ -196,7 +196,8 @@ show_info (GFile *file, GFileInfo *info)
g_print (" %"G_GUINT64_FORMAT"\n", (guint64)size);
}
- if (g_file_info_get_is_hidden (info))
+ if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN) &&
+ g_file_info_get_is_hidden (info))
g_print (_("hidden\n"));
uri = g_file_get_uri (file);