hopefully plugged a possible security hole. Please audit this fix!
--Sven
This commit is contained in:
@ -1,3 +1,6 @@
|
|||||||
|
Tue Nov 23 02:02:30 MET 1999 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/menus.c: fixed a possible buffer overflow
|
||||||
|
|
||||||
Mon Nov 22 22:43:59 GMT 1999 Andy Thomas <alt@gimp.org>
|
Mon Nov 22 22:43:59 GMT 1999 Andy Thomas <alt@gimp.org>
|
||||||
|
|
||||||
|
@ -934,16 +934,9 @@ menus_reorder_plugins (void)
|
|||||||
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
||||||
sizeof (xtns_plugins[0]));
|
sizeof (xtns_plugins[0]));
|
||||||
|
|
||||||
static gchar *rotate_plugins[] = { "90 degrees",
|
|
||||||
"180 degrees",
|
|
||||||
"270 degrees" };
|
|
||||||
static gint n_rotate_plugins = (sizeof (rotate_plugins) /
|
|
||||||
sizeof (rotate_plugins[0]));
|
|
||||||
|
|
||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
GtkWidget *menu_item;
|
GtkWidget *menu_item;
|
||||||
GList *list;
|
GList *list;
|
||||||
gchar *path;
|
|
||||||
gint i, pos;
|
gint i, pos;
|
||||||
|
|
||||||
/* Beautify <Toolbox>/Xtns */
|
/* Beautify <Toolbox>/Xtns */
|
||||||
@ -980,32 +973,6 @@ menus_reorder_plugins (void)
|
|||||||
if (menu_item->submenu)
|
if (menu_item->submenu)
|
||||||
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reorder Rotate plugin menu entries */
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Image/Transforms/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Layers/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1538,34 +1505,38 @@ menus_init (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MENUPATH_SIZE 384
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
menu_translate (const gchar *path,
|
menu_translate (const gchar *path,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
static gchar menupath[256];
|
static gchar menupath[MENUPATH_SIZE];
|
||||||
gchar *retval;
|
gchar *retval;
|
||||||
|
|
||||||
|
menupath[MENUPATH_SIZE - 1] = '\0';
|
||||||
|
|
||||||
retval = gettext (path);
|
retval = gettext (path);
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, path);
|
strncpy (menupath, path, MENUPATH_SIZE - 1);
|
||||||
strncat (menupath, "/tearoff1", sizeof (menupath) - strlen (menupath) - 1);
|
strncat (menupath, "/tearoff1", MENUPATH_SIZE - 1 - strlen (menupath));
|
||||||
retval = gettext (menupath);
|
retval = gettext (menupath);
|
||||||
if (strcmp (menupath, retval))
|
if (strcmp (menupath, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, retval);
|
strncpy (menupath, retval, MENUPATH_SIZE - 1);
|
||||||
*(strrchr(menupath, '/')) = '\0';
|
*(strrchr(menupath, '/')) = '\0';
|
||||||
return menupath;
|
return menupath;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Image>");
|
strcpy (menupath, "<Image>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Image>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Image>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Toolbox>");
|
strcpy (menupath, "<Toolbox>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Toolbox>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Toolbox>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1600,7 +1571,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
/* This should be a window */
|
/* This should be a window */
|
||||||
if (!GTK_IS_WINDOW (top))
|
if (!GTK_IS_WINDOW (top))
|
||||||
{
|
{
|
||||||
g_message("tearoff menu not in top level window");
|
g_message(_("tearoff menu not in top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1623,7 +1594,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
|
|
||||||
if (!top)
|
if (!top)
|
||||||
{
|
{
|
||||||
g_message ("can't unregister tearoff menu top level window");
|
g_message (_("can't unregister tearoff menu top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
53
app/menus.c
53
app/menus.c
@ -934,16 +934,9 @@ menus_reorder_plugins (void)
|
|||||||
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
||||||
sizeof (xtns_plugins[0]));
|
sizeof (xtns_plugins[0]));
|
||||||
|
|
||||||
static gchar *rotate_plugins[] = { "90 degrees",
|
|
||||||
"180 degrees",
|
|
||||||
"270 degrees" };
|
|
||||||
static gint n_rotate_plugins = (sizeof (rotate_plugins) /
|
|
||||||
sizeof (rotate_plugins[0]));
|
|
||||||
|
|
||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
GtkWidget *menu_item;
|
GtkWidget *menu_item;
|
||||||
GList *list;
|
GList *list;
|
||||||
gchar *path;
|
|
||||||
gint i, pos;
|
gint i, pos;
|
||||||
|
|
||||||
/* Beautify <Toolbox>/Xtns */
|
/* Beautify <Toolbox>/Xtns */
|
||||||
@ -980,32 +973,6 @@ menus_reorder_plugins (void)
|
|||||||
if (menu_item->submenu)
|
if (menu_item->submenu)
|
||||||
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reorder Rotate plugin menu entries */
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Image/Transforms/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Layers/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1538,34 +1505,38 @@ menus_init (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MENUPATH_SIZE 384
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
menu_translate (const gchar *path,
|
menu_translate (const gchar *path,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
static gchar menupath[256];
|
static gchar menupath[MENUPATH_SIZE];
|
||||||
gchar *retval;
|
gchar *retval;
|
||||||
|
|
||||||
|
menupath[MENUPATH_SIZE - 1] = '\0';
|
||||||
|
|
||||||
retval = gettext (path);
|
retval = gettext (path);
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, path);
|
strncpy (menupath, path, MENUPATH_SIZE - 1);
|
||||||
strncat (menupath, "/tearoff1", sizeof (menupath) - strlen (menupath) - 1);
|
strncat (menupath, "/tearoff1", MENUPATH_SIZE - 1 - strlen (menupath));
|
||||||
retval = gettext (menupath);
|
retval = gettext (menupath);
|
||||||
if (strcmp (menupath, retval))
|
if (strcmp (menupath, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, retval);
|
strncpy (menupath, retval, MENUPATH_SIZE - 1);
|
||||||
*(strrchr(menupath, '/')) = '\0';
|
*(strrchr(menupath, '/')) = '\0';
|
||||||
return menupath;
|
return menupath;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Image>");
|
strcpy (menupath, "<Image>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Image>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Image>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Toolbox>");
|
strcpy (menupath, "<Toolbox>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Toolbox>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Toolbox>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1600,7 +1571,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
/* This should be a window */
|
/* This should be a window */
|
||||||
if (!GTK_IS_WINDOW (top))
|
if (!GTK_IS_WINDOW (top))
|
||||||
{
|
{
|
||||||
g_message("tearoff menu not in top level window");
|
g_message(_("tearoff menu not in top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1623,7 +1594,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
|
|
||||||
if (!top)
|
if (!top)
|
||||||
{
|
{
|
||||||
g_message ("can't unregister tearoff menu top level window");
|
g_message (_("can't unregister tearoff menu top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -934,16 +934,9 @@ menus_reorder_plugins (void)
|
|||||||
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
||||||
sizeof (xtns_plugins[0]));
|
sizeof (xtns_plugins[0]));
|
||||||
|
|
||||||
static gchar *rotate_plugins[] = { "90 degrees",
|
|
||||||
"180 degrees",
|
|
||||||
"270 degrees" };
|
|
||||||
static gint n_rotate_plugins = (sizeof (rotate_plugins) /
|
|
||||||
sizeof (rotate_plugins[0]));
|
|
||||||
|
|
||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
GtkWidget *menu_item;
|
GtkWidget *menu_item;
|
||||||
GList *list;
|
GList *list;
|
||||||
gchar *path;
|
|
||||||
gint i, pos;
|
gint i, pos;
|
||||||
|
|
||||||
/* Beautify <Toolbox>/Xtns */
|
/* Beautify <Toolbox>/Xtns */
|
||||||
@ -980,32 +973,6 @@ menus_reorder_plugins (void)
|
|||||||
if (menu_item->submenu)
|
if (menu_item->submenu)
|
||||||
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reorder Rotate plugin menu entries */
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Image/Transforms/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Layers/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1538,34 +1505,38 @@ menus_init (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MENUPATH_SIZE 384
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
menu_translate (const gchar *path,
|
menu_translate (const gchar *path,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
static gchar menupath[256];
|
static gchar menupath[MENUPATH_SIZE];
|
||||||
gchar *retval;
|
gchar *retval;
|
||||||
|
|
||||||
|
menupath[MENUPATH_SIZE - 1] = '\0';
|
||||||
|
|
||||||
retval = gettext (path);
|
retval = gettext (path);
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, path);
|
strncpy (menupath, path, MENUPATH_SIZE - 1);
|
||||||
strncat (menupath, "/tearoff1", sizeof (menupath) - strlen (menupath) - 1);
|
strncat (menupath, "/tearoff1", MENUPATH_SIZE - 1 - strlen (menupath));
|
||||||
retval = gettext (menupath);
|
retval = gettext (menupath);
|
||||||
if (strcmp (menupath, retval))
|
if (strcmp (menupath, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, retval);
|
strncpy (menupath, retval, MENUPATH_SIZE - 1);
|
||||||
*(strrchr(menupath, '/')) = '\0';
|
*(strrchr(menupath, '/')) = '\0';
|
||||||
return menupath;
|
return menupath;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Image>");
|
strcpy (menupath, "<Image>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Image>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Image>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Toolbox>");
|
strcpy (menupath, "<Toolbox>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Toolbox>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Toolbox>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1600,7 +1571,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
/* This should be a window */
|
/* This should be a window */
|
||||||
if (!GTK_IS_WINDOW (top))
|
if (!GTK_IS_WINDOW (top))
|
||||||
{
|
{
|
||||||
g_message("tearoff menu not in top level window");
|
g_message(_("tearoff menu not in top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1623,7 +1594,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
|
|
||||||
if (!top)
|
if (!top)
|
||||||
{
|
{
|
||||||
g_message ("can't unregister tearoff menu top level window");
|
g_message (_("can't unregister tearoff menu top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -934,16 +934,9 @@ menus_reorder_plugins (void)
|
|||||||
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
static gint n_xtns_plugins = (sizeof (xtns_plugins) /
|
||||||
sizeof (xtns_plugins[0]));
|
sizeof (xtns_plugins[0]));
|
||||||
|
|
||||||
static gchar *rotate_plugins[] = { "90 degrees",
|
|
||||||
"180 degrees",
|
|
||||||
"270 degrees" };
|
|
||||||
static gint n_rotate_plugins = (sizeof (rotate_plugins) /
|
|
||||||
sizeof (rotate_plugins[0]));
|
|
||||||
|
|
||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
GtkWidget *menu_item;
|
GtkWidget *menu_item;
|
||||||
GList *list;
|
GList *list;
|
||||||
gchar *path;
|
|
||||||
gint i, pos;
|
gint i, pos;
|
||||||
|
|
||||||
/* Beautify <Toolbox>/Xtns */
|
/* Beautify <Toolbox>/Xtns */
|
||||||
@ -980,32 +973,6 @@ menus_reorder_plugins (void)
|
|||||||
if (menu_item->submenu)
|
if (menu_item->submenu)
|
||||||
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reorder Rotate plugin menu entries */
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Image/Transforms/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
pos = 2;
|
|
||||||
for (i = 0; i < n_rotate_plugins; i++)
|
|
||||||
{
|
|
||||||
path = g_strconcat ("/Layers/Rotate/", rotate_plugins[i], NULL);
|
|
||||||
menu_item = gtk_item_factory_get_widget (image_factory, path);
|
|
||||||
if (menu_item && menu_item->parent)
|
|
||||||
{
|
|
||||||
gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, pos);
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1538,34 +1505,38 @@ menus_init (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MENUPATH_SIZE 384
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
menu_translate (const gchar *path,
|
menu_translate (const gchar *path,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
static gchar menupath[256];
|
static gchar menupath[MENUPATH_SIZE];
|
||||||
gchar *retval;
|
gchar *retval;
|
||||||
|
|
||||||
|
menupath[MENUPATH_SIZE - 1] = '\0';
|
||||||
|
|
||||||
retval = gettext (path);
|
retval = gettext (path);
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, path);
|
strncpy (menupath, path, MENUPATH_SIZE - 1);
|
||||||
strncat (menupath, "/tearoff1", sizeof (menupath) - strlen (menupath) - 1);
|
strncat (menupath, "/tearoff1", MENUPATH_SIZE - 1 - strlen (menupath));
|
||||||
retval = gettext (menupath);
|
retval = gettext (menupath);
|
||||||
if (strcmp (menupath, retval))
|
if (strcmp (menupath, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, retval);
|
strncpy (menupath, retval, MENUPATH_SIZE - 1);
|
||||||
*(strrchr(menupath, '/')) = '\0';
|
*(strrchr(menupath, '/')) = '\0';
|
||||||
return menupath;
|
return menupath;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Image>");
|
strcpy (menupath, "<Image>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Image>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Image>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
|
||||||
if (!strcmp (path, retval))
|
if (!strcmp (path, retval))
|
||||||
{
|
{
|
||||||
strcpy (menupath, "<Toolbox>");
|
strcpy (menupath, "<Toolbox>");
|
||||||
strncat (menupath, path, sizeof (menupath) - sizeof ("<Toolbox>"));
|
strncat (menupath, path, MENUPATH_SIZE - 1 - sizeof ("<Toolbox>"));
|
||||||
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1600,7 +1571,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
/* This should be a window */
|
/* This should be a window */
|
||||||
if (!GTK_IS_WINDOW (top))
|
if (!GTK_IS_WINDOW (top))
|
||||||
{
|
{
|
||||||
g_message("tearoff menu not in top level window");
|
g_message(_("tearoff menu not in top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1623,7 +1594,7 @@ tearoff_cmd_callback (GtkWidget *widget,
|
|||||||
|
|
||||||
if (!top)
|
if (!top)
|
||||||
{
|
{
|
||||||
g_message ("can't unregister tearoff menu top level window");
|
g_message (_("can't unregister tearoff menu top level window"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user