void-packages/srcpkgs/gimp/patches/fix-segfault.patch
Đoàn Trần Công Danh 7fc9190f0e srcpkgs/g*: convert patches to -Np1
* gcc is kept at -Np0, because of void-cross

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

169 lines
6.4 KiB
Diff

diff --git app/dialogs/dialogs.c app/dialogs/dialogs.c
index 064f2c4..b17d82f 100644
--- a/app/dialogs/dialogs.c
+++ b/app/dialogs/dialogs.c
@@ -534,11 +534,15 @@ dialogs_init (Gimp *gimp,
menu_factory);
gimp_dialog_factory_set_singleton (factory);
- for (i = 0; i < G_N_ELEMENTS (entries); i++)
+ for (i = 0; i < G_N_ELEMENTS (entries); i++) {
+ char *name, *blurb;
+ name = entries[i].name ? gettext(entries[i].name) : NULL;
+ blurb = entries[i].blurb ? gettext(entries[i].blurb) : NULL;
+
gimp_dialog_factory_register_entry (factory,
entries[i].identifier,
- gettext (entries[i].name),
- gettext (entries[i].blurb),
+ name,
+ blurb,
entries[i].icon_name,
entries[i].help_id,
entries[i].new_func,
@@ -551,6 +555,7 @@ dialogs_init (Gimp *gimp,
entries[i].hideable,
entries[i].image_window,
entries[i].dockable);
+ }
global_recent_docks = gimp_list_new (GIMP_TYPE_SESSION_INFO, FALSE);
}
diff --git app/widgets/gimpactiongroup.c app/widgets/gimpactiongroup.c
index 04bd1b6..12eff51 100644
--- a/app/widgets/gimpactiongroup.c
+++ b/app/widgets/gimpactiongroup.c
@@ -393,7 +393,7 @@ gimp_action_group_add_actions (GimpActionGroup *group,
for (i = 0; i < n_entries; i++)
{
GimpAction *action;
- const gchar *label;
+ const gchar *label = NULL;
const gchar *tooltip = NULL;
if (! gimp_action_group_check_unique_action (group, entries[i].name))
@@ -401,15 +401,18 @@ gimp_action_group_add_actions (GimpActionGroup *group,
if (msg_context)
{
- label = g_dpgettext2 (NULL, msg_context, entries[i].label);
+ if (entries[i].label)
+ label = g_dpgettext2 (NULL, msg_context, entries[i].label);
if (entries[i].tooltip)
tooltip = g_dpgettext2 (NULL, msg_context, entries[i].tooltip);
}
else
{
- label = gettext (entries[i].label);
- tooltip = gettext (entries[i].tooltip);
+ if (entries[i].label)
+ label = gettext (entries[i].label);
+ if (entries[i].tooltip)
+ tooltip = gettext (entries[i].tooltip);
}
action = gimp_action_impl_new (entries[i].name, label, tooltip,
@@ -450,15 +453,18 @@ gimp_action_group_add_toggle_actions (GimpActionGroup *group,
if (msg_context)
{
- label = g_dpgettext2 (NULL, msg_context, entries[i].label);
+ if (entries[i].label)
+ label = g_dpgettext2 (NULL, msg_context, entries[i].label);
if (entries[i].tooltip)
tooltip = g_dpgettext2 (NULL, msg_context, entries[i].tooltip);
}
else
{
- label = gettext (entries[i].label);
- tooltip = gettext (entries[i].tooltip);
+ if (entries[i].label)
+ label = gettext (entries[i].label);
+ if (entries[i].tooltip)
+ tooltip = gettext (entries[i].tooltip);
}
action = gimp_toggle_action_new (entries[i].name, label, tooltip,
@@ -504,17 +510,20 @@ gimp_action_group_add_radio_actions (GimpActionGroup *group,
if (! gimp_action_group_check_unique_action (group, entries[i].name))
continue;
- if (msg_context)
+ if (msg_context)
{
- label = g_dpgettext2 (NULL, msg_context, entries[i].label);
+ if (entries[i].label)
+ label = g_dpgettext2 (NULL, msg_context, entries[i].label);
if (entries[i].tooltip)
tooltip = g_dpgettext2 (NULL, msg_context, entries[i].tooltip);
}
else
{
- label = gettext (entries[i].label);
- tooltip = gettext (entries[i].tooltip);
+ if (entries[i].label)
+ label = gettext (entries[i].label);
+ if (entries[i].tooltip)
+ tooltip = gettext (entries[i].tooltip);
}
action = gimp_radio_action_new (entries[i].name, label, tooltip,
@@ -560,7 +569,7 @@ gimp_action_group_add_enum_actions (GimpActionGroup *group,
for (i = 0; i < n_entries; i++)
{
GimpEnumAction *action;
- const gchar *label;
+ const gchar *label = NULL;
const gchar *tooltip = NULL;
if (! gimp_action_group_check_unique_action (group, entries[i].name))
@@ -568,15 +577,18 @@ gimp_action_group_add_enum_actions (GimpActionGroup *group,
if (msg_context)
{
- label = g_dpgettext2 (NULL, msg_context, entries[i].label);
+ if (entries[i].label)
+ label = g_dpgettext2 (NULL, msg_context, entries[i].label);
if (entries[i].tooltip)
tooltip = g_dpgettext2 (NULL, msg_context, entries[i].tooltip);
}
else
{
- label = gettext (entries[i].label);
- tooltip = gettext (entries[i].tooltip);
+ if (entries[i].label)
+ label = gettext (entries[i].label);
+ if (entries[i].tooltip)
+ tooltip = gettext (entries[i].tooltip);
}
action = gimp_enum_action_new (entries[i].name, label, tooltip,
@@ -618,17 +630,20 @@ gimp_action_group_add_string_actions (GimpActionGroup *group,
if (! gimp_action_group_check_unique_action (group, entries[i].name))
continue;
- if (msg_context)
+ if (msg_context)
{
- label = g_dpgettext2 (NULL, msg_context, entries[i].label);
+ if (entries[i].label)
+ label = g_dpgettext2 (NULL, msg_context, entries[i].label);
if (entries[i].tooltip)
tooltip = g_dpgettext2 (NULL, msg_context, entries[i].tooltip);
}
else
{
- label = gettext (entries[i].label);
- tooltip = gettext (entries[i].tooltip);
+ if (entries[i].label)
+ label = gettext (entries[i].label);
+ if (entries[i].tooltip)
+ tooltip = gettext (entries[i].tooltip);
}
action = gimp_string_action_new (entries[i].name, label, tooltip,