$OpenBSD: patch-gio_gtlscertificate_c,v 1.1 2014/04/10 07:29:06 ajacoutot Exp $

From a36ed2715670b35b2718e8ffe0493d9d921e55b5 Mon Sep 17 00:00:00 2001
From: Dan Winship <danw@gnome.org>
Date: Wed, 9 Apr 2014 10:39:45 -0400
Subject: gtlscertificate: fix certificate list parsing with trailing comments

--- gio/gtlscertificate.c.orig	Sat Feb 22 16:29:07 2014
+++ gio/gtlscertificate.c	Thu Apr 10 09:09:34 2014
@@ -476,19 +476,24 @@ g_tls_certificate_list_new_from_file (const gchar  *fi
     {
       gchar *cert_pem;
       GTlsCertificate *cert = NULL;
+      GError *parse_error = NULL;
 
-      cert_pem = parse_next_pem_certificate (&p, end, FALSE, error);
+      cert_pem = parse_next_pem_certificate (&p, end, FALSE, &parse_error);
       if (cert_pem)
-	{
-	  cert = g_tls_certificate_new_internal (cert_pem, NULL, error);
-	  g_free (cert_pem);
-	}
+        {
+          cert = g_tls_certificate_new_internal (cert_pem, NULL, &parse_error);
+          g_free (cert_pem);
+        }
       if (!cert)
-	{
-	  g_list_free_full (queue.head, g_object_unref);
-	  queue.head = NULL;
-	  break;
-	}
+        {
+          if (parse_error)
+            {
+              g_propagate_error (error, parse_error);
+              g_list_free_full (queue.head, g_object_unref);
+              queue.head = NULL;
+            }
+          break;
+        }
       g_queue_push_tail (&queue, cert);
     }
 
