From be85960df70b8dbd216c4322fb373bd9498de221 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 11 Feb 2008 12:21:49 +0000 Subject: [PATCH] Correctly handle NULL GAttributeMatcher meaning matches nothing. (Fixes 2008-02-11 Alexander Larsson * gfileinfo.c: (g_file_info_set_attribute_mask): (g_file_attribute_matcher_matches_id): Correctly handle NULL GAttributeMatcher meaning matches nothing. (Fixes #513492) svn path=/trunk/; revision=6498 --- gio/ChangeLog | 8 ++++++++ gio/gfileinfo.c | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index c47b55d24..114db45ce 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,11 @@ +2008-02-11 Alexander Larsson + + * gfileinfo.c: + (g_file_info_set_attribute_mask): + (g_file_attribute_matcher_matches_id): + Correctly handle NULL GAttributeMatcher meaning + matches nothing. (Fixes #513492) + 2008-02-11 Alexander Larsson * gfile.[ch]: diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c index 17768ed07..b04a984dc 100644 --- a/gio/gfileinfo.c +++ b/gio/gfileinfo.c @@ -343,7 +343,6 @@ g_file_info_set_attribute_mask (GFileInfo *info, int i; g_return_if_fail (G_IS_FILE_INFO (info)); - g_return_if_fail (mask != NULL); if (mask != info->mask) { @@ -2035,7 +2034,9 @@ static gboolean g_file_attribute_matcher_matches_id (GFileAttributeMatcher *matcher, guint32 id) { - g_return_val_if_fail (matcher != NULL, FALSE); + /* We return a NULL matcher for an empty match string, so handle this */ + if (matcher == NULL) + return FALSE; if (matcher->all) return TRUE;