Correctly handle NULL GAttributeMatcher meaning matches nothing. (Fixes
authorAlexander Larsson <alexl@redhat.com>
Mon, 11 Feb 2008 12:21:49 +0000 (12:21 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Mon, 11 Feb 2008 12:21:49 +0000 (12:21 +0000)
2008-02-11  Alexander Larsson  <alexl@redhat.com>

        * 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
gio/gfileinfo.c

index c47b55d24d9d1136cb7466b21fc9ddb4ac9cf768..114db45ced97c658c03878c9a4539afb47cd7201 100644 (file)
@@ -1,3 +1,11 @@
+2008-02-11  Alexander Larsson  <alexl@redhat.com>
+
+        * 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  <alexl@redhat.com>
 
         * gfile.[ch]:
index 17768ed073badfb7b3ad79fa478d0fba07e5e5ae..b04a984dc250e850d2b331852bc47cc705b0e64d 100644 (file)
@@ -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;