summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Fairley <rfairley@redhat.com>2019-02-14 16:14:03 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2019-03-01 21:20:35 +0000
commit91892e3c3f31d104796584c6975f4a198faf750f (patch)
tree07123167dd3c8ea4a09229aed3a13db8d05eb7e2
parent52987b532ca3fb02030f3710b9ae7eadcd4e69a3 (diff)
downloadostree-91892e3c3f31d104796584c6975f4a198faf750f.tar.gz
libotutil: Rename to ot_keyfile_get_string_list_with_separator_choice()
Rename ot_keyfile_get_string_as_list() to ot_keyfile_get_string_list_with_separator_choice() which expresses more clearly why the function is needed. Also shorten the function comment. Closes: #1814 Approved by: jlebon
-rw-r--r--src/libostree/ostree-repo.c8
-rw-r--r--src/libotutil/ot-keyfile-utils.c23
-rw-r--r--src/libotutil/ot-keyfile-utils.h12
3 files changed, 23 insertions, 20 deletions
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 37a6cdf0..a71f3bda 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -5186,8 +5186,12 @@ _ostree_repo_gpg_verify_data_internal (OstreeRepo *self,
g_auto(GStrv) gpgkeypath_list = NULL;
- if (!ot_keyfile_get_string_as_list (remote->options, remote->group, "gpgkeypath",
- ";,", &gpgkeypath_list, error))
+ if (!ot_keyfile_get_string_list_with_separator_choice (remote->options,
+ remote->group,
+ "gpgkeypath",
+ ";,",
+ &gpgkeypath_list,
+ error))
return NULL;
if (gpgkeypath_list)
diff --git a/src/libotutil/ot-keyfile-utils.c b/src/libotutil/ot-keyfile-utils.c
index a0ab75cc..2af48a6e 100644
--- a/src/libotutil/ot-keyfile-utils.c
+++ b/src/libotutil/ot-keyfile-utils.c
@@ -101,20 +101,19 @@ ot_keyfile_get_value_with_default (GKeyFile *keyfile,
return ret;
}
-/* Read the value of key as a string. If the value string contains
- * one of the separators and none of the others, read the
- * string as a NULL-terminated array out_value. If the value string contains
- * none of the separators, read the string as a single entry into a
- * NULL-terminated array out_value. If the value string contains multiple of
- * the separators, an error is given.
+/* Read the value of key as a string. If the value string contains
+ * zero or one of the separators and none of the others, read the
+ * string as a NULL-terminated array out_value. If the value string
+ * contains multiple of the separators, give an error.
+ *
* Returns TRUE on success, FALSE on error. */
gboolean
-ot_keyfile_get_string_as_list (GKeyFile *keyfile,
- const char *section,
- const char *key,
- const char *separators,
- char ***out_value,
- GError **error)
+ot_keyfile_get_string_list_with_separator_choice (GKeyFile *keyfile,
+ const char *section,
+ const char *key,
+ const char *separators,
+ char ***out_value,
+ GError **error)
{
guint sep_count = 0;
gchar sep = '\0';
diff --git a/src/libotutil/ot-keyfile-utils.h b/src/libotutil/ot-keyfile-utils.h
index 2dcb899c..1a03cc26 100644
--- a/src/libotutil/ot-keyfile-utils.h
+++ b/src/libotutil/ot-keyfile-utils.h
@@ -45,12 +45,12 @@ ot_keyfile_get_value_with_default (GKeyFile *keyfile,
GError **error);
gboolean
-ot_keyfile_get_string_as_list (GKeyFile *keyfile,
- const char *section,
- const char *key,
- const char *separators,
- char ***out_value_list,
- GError **error);
+ot_keyfile_get_string_list_with_separator_choice (GKeyFile *keyfile,
+ const char *section,
+ const char *key,
+ const char *separators,
+ char ***out_value_list,
+ GError **error);
gboolean
ot_keyfile_get_string_list_with_default (GKeyFile *keyfile,