mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Merge branch 'option-context-translations' into 'master'
goption: Treat an empty option context parameter string as NULL See merge request GNOME/glib!1469
This commit is contained in:
commit
493b01c305
@ -241,7 +241,7 @@ struct _GOptionContext
|
||||
{
|
||||
GList *groups;
|
||||
|
||||
gchar *parameter_string;
|
||||
gchar *parameter_string; /* (nullable) */
|
||||
gchar *summary;
|
||||
gchar *description;
|
||||
|
||||
@ -364,6 +364,11 @@ g_option_context_new (const gchar *parameter_string)
|
||||
|
||||
context = g_new0 (GOptionContext, 1);
|
||||
|
||||
/* Clear the empty string to NULL, otherwise we end up calling gettext(""),
|
||||
* which returns the translation header. */
|
||||
if (parameter_string != NULL && *parameter_string == '\0')
|
||||
parameter_string = NULL;
|
||||
|
||||
context->parameter_string = g_strdup (parameter_string);
|
||||
context->strict_posix = FALSE;
|
||||
context->help_enabled = TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user