[glib: 1/3] gwin32registrykey: Fix returning subkey_name in subkey_iter_get_name()




commit b01521b4cd46799110e84cd28e56813b39f50965
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Thu Oct 1 17:16:34 2020 +0100

    gwin32registrykey: Fix returning subkey_name in subkey_iter_get_name()

 gio/gwin32registrykey.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
index a963d6c0d..7b4905347 100644
--- a/gio/gwin32registrykey.c
+++ b/gio/gwin32registrykey.c
@@ -1013,13 +1013,15 @@ g_win32_registry_subkey_iter_get_name (GWin32RegistrySubkeyIter  *iter,
                                           &subkey_name_len_glong,
                                           error);
 
-  if (iter->subkey_name_u8 != NULL)
-    {
-      *subkey_name_len = subkey_name_len_glong;
-      return TRUE;
-    }
+  if (iter->subkey_name_u8 == NULL)
+    return FALSE;
 
-  return FALSE;
+  *subkey_name = iter->subkey_name_u8;
+
+  if (subkey_name_len)
+    *subkey_name_len = subkey_name_len_glong;
+
+  return TRUE;
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]