<commit_before>From aad2b4a10fc1e21155724c6cc2bd735a589ad626 Mon Sep 17 00:00:00 2001
From: <NAME> <<EMAIL>>
Date: Tue, 1 Nov 2016 19:48:12 +0000
Subject: [PATCH 4/4] gtlsbackend-gnutls: Get anchor file relative to libgio on
 Windows

---
 tls/gnutls/gtlsbackend-gnutls.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tls/gnutls/gtlsbackend-gnutls.c b/tls/gnutls/gtlsbackend-gnutls.c
index 1cf9127..74c98af 100644
--- a/tls/gnutls/gtlsbackend-gnutls.c
+++ b/tls/gnutls/gtlsbackend-gnutls.c
@@ -38,6 +38,10 @@
 #include <dlfcn.h>
 #endif
 
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
+
 struct _GTlsBackendGnutlsPrivate
 {
   GMutex mutex;
@@ -154,6 +158,22 @@ g_tls_backend_gnutls_real_create_database (GTlsBackendGnutls  *self,
     }
 #endif
 
+#ifdef G_OS_WIN32
+    if (!anchor_file || !g_file_test (anchor_file, G_FILE_TEST_IS_REGULAR))
+      {
+        HMODULE module;
+        gchar *module_path;
+        module = GetModuleHandle ("libgio-2.0-0.dll");
+        if (module)
+          {
+            module_path = g_win32_get_package_installation_directory_of_module (module);
+            if (module_path)
+              anchor_file = g_build_filename (module_path, "etc", "ssl", "certs", "ca-certificates.crt", NULL);
+            g_free (module_path);
+          }
+      }
+#endif
+
 #ifdef GST_CA_CERTIFICATES_FROM_ENV
   anchor_file = g_getenv ("CA_CERTIFICATES");
 #endif
-- 
2.6.3.windows.1
<commit_msg>glib-networking: Fix memory leak in last patch on Windows<commit_after>From 6f3db1bb19c5f06dda25f13aa1e1a381233f3fd2 Mon Sep 17 00:00:00 2001
From: <NAME> <<EMAIL>>
Date: Tue, 1 Nov 2016 19:48:12 +0000
Subject: [PATCH 4/4] gtlsbackend-gnutls: Get anchor file relative to libgio on
 Windows

---
 tls/gnutls/gtlsbackend-gnutls.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/tls/gnutls/gtlsbackend-gnutls.c b/tls/gnutls/gtlsbackend-gnutls.c
index 1cf9127..8b281e5 100644
--- a/tls/gnutls/gtlsbackend-gnutls.c
+++ b/tls/gnutls/gtlsbackend-gnutls.c
@@ -38,6 +38,10 @@
 #include <dlfcn.h>
 #endif
 
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
+
 struct _GTlsBackendGnutlsPrivate
 {
   GMutex mutex;
@@ -124,7 +128,7 @@ g_tls_backend_gnutls_real_create_database (GTlsBackendGnutls  *self,
 {
   const gchar *anchor_file = NULL;
   GTlsDatabase *db = NULL;
-#ifdef HAVE_DLADDR
+#if defined(HAVE_DLADDR) || defined(G_OS_WIN32)
   gchar *free_me = NULL;
 #endif
 
@@ -154,12 +158,28 @@ g_tls_backend_gnutls_real_create_database (GTlsBackendGnutls  *self,
     }
 #endif
 
+#ifdef G_OS_WIN32
+    if (!anchor_file || !g_file_test (anchor_file, G_FILE_TEST_IS_REGULAR))
+      {
+        HMODULE module;
+        gchar *module_path;
+        module = GetModuleHandle ("libgio-2.0-0.dll");
+        if (module)
+          {
+            module_path = g_win32_get_package_installation_directory_of_module (module);
+            if (module_path)
+              anchor_file = free_me = g_build_filename (module_path, "etc", "ssl", "certs", "ca-certificates.crt", NULL);
+            g_free (module_path);
+          }
+      }
+#endif
+
 #ifdef GST_CA_CERTIFICATES_FROM_ENV
   anchor_file = g_getenv ("CA_CERTIFICATES");
 #endif
   db = g_tls_file_database_new (anchor_file, error);
 
-#ifdef HAVE_DLADDR
+#if defined(HAVE_DLADDR) || defined(G_OS_WIN32)
   g_free (free_me);
 #endif
   return db;
-- 
2.10.2

{'fraction_non_alphanumeric': 0.14210061782877317, 'fraction_numerical': 0.06384230656075317, 'mean_word_length': 3.5945945945945947, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5835913', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1355, 'n_words': 254}