Only set the prgname if it hasn't been set before. (#334611, Chong Kai

2006-03-15  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.c (g_option_context_parse): Only set the prgname
	if it hasn't been set before.  (#334611, Chong Kai Xiong)
This commit is contained in:
Matthias Clasen 2006-03-15 13:03:48 +00:00 committed by Matthias Clasen
parent 9e58246669
commit 79a5c739a4
4 changed files with 27 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2006-03-15 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (g_option_context_parse): Only set the prgname
if it hasn't been set before. (#334611, Chong Kai Xiong)
2006-03-14 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_parse_debug_string): Don't read past the

View File

@ -1,3 +1,8 @@
2006-03-15 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (g_option_context_parse): Only set the prgname
if it hasn't been set before. (#334611, Chong Kai Xiong)
2006-03-14 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_parse_debug_string): Don't read past the

View File

@ -1,3 +1,8 @@
2006-03-15 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (g_option_context_parse): Only set the prgname
if it hasn't been set before. (#334611, Chong Kai Xiong)
2006-03-14 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_parse_debug_string): Don't read past the

View File

@ -1232,19 +1232,20 @@ g_option_context_parse (GOptionContext *context,
GList *list;
/* Set program name */
if (argc && argv && *argc)
if (!g_get_prgname())
{
gchar *prgname;
prgname = g_path_get_basename ((*argv)[0]);
g_set_prgname (prgname);
g_free (prgname);
if (argc && argv && *argc)
{
gchar *prgname;
prgname = g_path_get_basename ((*argv)[0]);
g_set_prgname (prgname);
g_free (prgname);
}
else
g_set_prgname ("<unknown>");
}
else
{
g_set_prgname ("<unknown>");
}
/* Call pre-parse hooks */
list = context->groups;
while (list)