mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
Add check for if argc is 0.
2004-10-05 Anders Carlsson <andersca@gnome.org> * glib/goption.c: (g_option_context_parse): Add check for if argc is 0. * tests/option-test.c: (empty_test3), (main): Add test case.
This commit is contained in:
parent
2118d96318
commit
9af2838a91
@ -1,3 +1,11 @@
|
|||||||
|
2004-10-05 Anders Carlsson <andersca@gnome.org>
|
||||||
|
|
||||||
|
* glib/goption.c: (g_option_context_parse):
|
||||||
|
Add check for if argc is 0.
|
||||||
|
|
||||||
|
* tests/option-test.c: (empty_test3), (main):
|
||||||
|
Add test case.
|
||||||
|
|
||||||
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* NEWS: Update
|
* NEWS: Update
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2004-10-05 Anders Carlsson <andersca@gnome.org>
|
||||||
|
|
||||||
|
* glib/goption.c: (g_option_context_parse):
|
||||||
|
Add check for if argc is 0.
|
||||||
|
|
||||||
|
* tests/option-test.c: (empty_test3), (main):
|
||||||
|
Add test case.
|
||||||
|
|
||||||
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* NEWS: Update
|
* NEWS: Update
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2004-10-05 Anders Carlsson <andersca@gnome.org>
|
||||||
|
|
||||||
|
* glib/goption.c: (g_option_context_parse):
|
||||||
|
Add check for if argc is 0.
|
||||||
|
|
||||||
|
* tests/option-test.c: (empty_test3), (main):
|
||||||
|
Add test case.
|
||||||
|
|
||||||
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* NEWS: Update
|
* NEWS: Update
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2004-10-05 Anders Carlsson <andersca@gnome.org>
|
||||||
|
|
||||||
|
* glib/goption.c: (g_option_context_parse):
|
||||||
|
Add check for if argc is 0.
|
||||||
|
|
||||||
|
* tests/option-test.c: (empty_test3), (main):
|
||||||
|
Add test case.
|
||||||
|
|
||||||
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* NEWS: Update
|
* NEWS: Update
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2004-10-05 Anders Carlsson <andersca@gnome.org>
|
||||||
|
|
||||||
|
* glib/goption.c: (g_option_context_parse):
|
||||||
|
Add check for if argc is 0.
|
||||||
|
|
||||||
|
* tests/option-test.c: (empty_test3), (main):
|
||||||
|
Add test case.
|
||||||
|
|
||||||
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
2004-10-05 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* NEWS: Update
|
* NEWS: Update
|
||||||
|
@ -825,7 +825,7 @@ g_option_context_parse (GOptionContext *context,
|
|||||||
GList *list;
|
GList *list;
|
||||||
|
|
||||||
/* Set program name */
|
/* Set program name */
|
||||||
if (argc && argv)
|
if (argc && argv && *argc)
|
||||||
{
|
{
|
||||||
gchar *prgname;
|
gchar *prgname;
|
||||||
|
|
||||||
|
@ -508,6 +508,22 @@ empty_test2 (void)
|
|||||||
g_option_context_free (context);
|
g_option_context_free (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
empty_test3 (void)
|
||||||
|
{
|
||||||
|
GOptionContext *context;
|
||||||
|
gint argc;
|
||||||
|
gchar **argv;
|
||||||
|
|
||||||
|
argc = 0;
|
||||||
|
argv = NULL;
|
||||||
|
|
||||||
|
context = g_option_context_new (NULL);
|
||||||
|
g_option_context_parse (context, &argc, &argv, NULL);
|
||||||
|
|
||||||
|
g_option_context_free (context);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -537,6 +553,7 @@ main (int argc, char **argv)
|
|||||||
/* Test parsing empty args */
|
/* Test parsing empty args */
|
||||||
empty_test1 ();
|
empty_test1 ();
|
||||||
empty_test2 ();
|
empty_test2 ();
|
||||||
|
empty_test3 ();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user