summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-06-13 19:09:06 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-06-13 19:09:06 +0000
commit9962a15cbaf36b29c2a20a52faf731e913fe6715 (patch)
treebf52ce869d95344d082e05abe4fcda43c36d5fa7
parent7c885b9057e46f9f3c92ffb91795ce1d4d1995e3 (diff)
downloadgtk+-9962a15cbaf36b29c2a20a52faf731e913fe6715.tar.gz
Try harder not to modify readonly strings. (#307541, Torsten Schoenfeld)
2005-06-13 Matthias Clasen <mclasen@redhat.com> * gtk/gtkaccellabel.c (_gtk_accel_label_class_get_accelerator_label): Try harder not to modify readonly strings. (#307541, Torsten Schoenfeld)
-rw-r--r--ChangeLog3
-rw-r--r--ChangeLog.pre-2-103
-rw-r--r--ChangeLog.pre-2-83
-rw-r--r--gtk/gtkaccellabel.c34
4 files changed, 27 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 658a87aa1c..1f1c306264 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2005-06-13 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkaccellabel.c (_gtk_accel_label_class_get_accelerator_label):
+ Try harder not to modify readonly strings. (#307541, Torsten Schoenfeld)
+
* gtk/gtkfilechooserbutton.c (model_update_current_folder):
Free the data of the row before overwriting it. (#307490,
Kjartan Maraas)
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 658a87aa1c..1f1c306264 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,8 @@
2005-06-13 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkaccellabel.c (_gtk_accel_label_class_get_accelerator_label):
+ Try harder not to modify readonly strings. (#307541, Torsten Schoenfeld)
+
* gtk/gtkfilechooserbutton.c (model_update_current_folder):
Free the data of the row before overwriting it. (#307490,
Kjartan Maraas)
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 658a87aa1c..1f1c306264 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,5 +1,8 @@
2005-06-13 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkaccellabel.c (_gtk_accel_label_class_get_accelerator_label):
+ Try harder not to modify readonly strings. (#307541, Torsten Schoenfeld)
+
* gtk/gtkfilechooserbutton.c (model_update_current_folder):
Free the data of the row before overwriting it. (#307490,
Kjartan Maraas)
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index cca5d342f9..cafd022018 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -590,25 +590,27 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
gchar *tmp;
tmp = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
- if (tmp == NULL)
- tmp = "";
- else if (tmp[0] != 0 && tmp[1] == 0)
- tmp[0] = g_ascii_toupper (tmp[0]);
- else
+ if (tmp != NULL)
{
- gchar msg[128];
- gchar *str;
-
- strcpy (msg, "keyboard label|");
- g_strlcat (msg, tmp, 128);
- str = dgettext (GETTEXT_PACKAGE, msg);
- if (str == msg)
- substitute_underscores (tmp);
+ if (tmp[0] != 0 && tmp[1] == 0)
+ g_string_append_c (gstring, g_ascii_toupper (tmp[0]));
else
- tmp = str;
+ {
+ gchar msg[128];
+ gchar *str;
+
+ strcpy (msg, "keyboard label|");
+ g_strlcat (msg, tmp, 128);
+ str = dgettext (GETTEXT_PACKAGE, msg);
+ if (str == msg)
+ {
+ g_string_append (gstring, tmp);
+ substitute_underscores (gstring->str);
+ }
+ else
+ g_string_append (gstring, str);
+ }
}
-
- g_string_append (gstring, tmp);
}
return g_string_free (gstring, FALSE);