Call post-parse hooks also if argv is NULL. (#161668, Marcin Krzyzanowski)
authorMatthias Clasen <mclasen@redhat.com>
Sun, 19 Dec 2004 05:20:12 +0000 (05:20 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 19 Dec 2004 05:20:12 +0000 (05:20 +0000)
2004-12-19  Matthias Clasen  <mclasen@redhat.com>

* glib/goption.c (g_option_context_parse): Call
post-parse hooks also if argv is NULL.  (#161668,
Marcin Krzyzanowski)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/goption.c

index 41a9f78..f070027 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (g_option_context_parse): Call
+       post-parse hooks also if argv is NULL.  (#161668,
+       Marcin Krzyzanowski)
+
 2004-12-16  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index 41a9f78..f070027 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (g_option_context_parse): Call
+       post-parse hooks also if argv is NULL.  (#161668,
+       Marcin Krzyzanowski)
+
 2004-12-16  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index 41a9f78..f070027 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (g_option_context_parse): Call
+       post-parse hooks also if argv is NULL.  (#161668,
+       Marcin Krzyzanowski)
+
 2004-12-16  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index 41a9f78..f070027 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (g_option_context_parse): Call
+       post-parse hooks also if argv is NULL.  (#161668,
+       Marcin Krzyzanowski)
+
 2004-12-16  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index 41a9f78..f070027 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (g_option_context_parse): Call
+       post-parse hooks also if argv is NULL.  (#161668,
+       Marcin Krzyzanowski)
+
 2004-12-16  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index 11e8671..373852c 100644 (file)
@@ -1324,30 +1324,33 @@ g_option_context_parse (GOptionContext   *context,
              
            }
        }
+    }
 
-      /* Call post-parse hooks */
-      list = context->groups;
-      while (list)
-       {
-         GOptionGroup *group = list->data;
-
-         if (group->post_parse_func)
-           {
-             if (!(* group->post_parse_func) (context, group,
-                                              group->user_data, error))
-               goto fail;
-           }
-         
-         list = list->next;
-       }
-
-      if (context->main_group && context->main_group->post_parse_func)
+  /* Call post-parse hooks */
+  list = context->groups;
+  while (list)
+    {
+      GOptionGroup *group = list->data;
+      
+      if (group->post_parse_func)
        {
-         if (!(* context->main_group->post_parse_func) (context, context->main_group,
-                                                        context->main_group->user_data, error))
+         if (!(* group->post_parse_func) (context, group,
+                                          group->user_data, error))
            goto fail;
        }
-
+      
+      list = list->next;
+    }
+  
+  if (context->main_group && context->main_group->post_parse_func)
+    {
+      if (!(* context->main_group->post_parse_func) (context, context->main_group,
+                                                    context->main_group->user_data, error))
+       goto fail;
+    }
+  
+  if (argc && argv)
+    {
       free_pending_nulls (context, TRUE);
       
       for (i = 1; i < *argc; i++)