mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Merge branch 'goption_add_sanity_checks_to_inputs' into 'master'
goption: add sanity check to input parameters Closes #1057 See merge request GNOME/glib!1073
This commit is contained in:
commit
202c07e904
@ -655,6 +655,7 @@ g_option_context_add_main_entries (GOptionContext *context,
|
||||
const GOptionEntry *entries,
|
||||
const gchar *translation_domain)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
g_return_if_fail (entries != NULL);
|
||||
|
||||
if (!context->main_group)
|
||||
@ -841,6 +842,8 @@ g_option_context_get_help (GOptionContext *context,
|
||||
GString *string;
|
||||
guchar token;
|
||||
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
|
||||
string = g_string_sized_new (1024);
|
||||
|
||||
rest_description = NULL;
|
||||
@ -1958,6 +1961,8 @@ g_option_context_parse (GOptionContext *context,
|
||||
gint i, j, k;
|
||||
GList *list;
|
||||
|
||||
g_return_val_if_fail (context != NULL, FALSE);
|
||||
|
||||
/* Set program name */
|
||||
if (!g_get_prgname())
|
||||
{
|
||||
@ -2405,6 +2410,7 @@ g_option_group_add_entries (GOptionGroup *group,
|
||||
{
|
||||
gsize i, n_entries;
|
||||
|
||||
g_return_if_fail (group != NULL);
|
||||
g_return_if_fail (entries != NULL);
|
||||
|
||||
for (n_entries = 0; entries[n_entries].long_name != NULL; n_entries++) ;
|
||||
@ -2745,6 +2751,8 @@ g_option_context_parse_strv (GOptionContext *context,
|
||||
gboolean success;
|
||||
gint argc;
|
||||
|
||||
g_return_val_if_fail (context != NULL, FALSE);
|
||||
|
||||
context->strv_mode = TRUE;
|
||||
argc = arguments && *arguments ? g_strv_length (*arguments) : 0;
|
||||
success = g_option_context_parse (context, &argc, arguments, error);
|
||||
|
Loading…
Reference in New Issue
Block a user