summaryrefslogtreecommitdiff
path: root/gobject/gvaluetypes.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>2001-03-18 04:44:38 +0000
committerTim Janik <timj@src.gnome.org>2001-03-18 04:44:38 +0000
commit45fb71949a0c0e27fe8d0948b345334f61a5c924 (patch)
tree1044cb22a18c41a892fc7a1d31362d59c0f0ad82 /gobject/gvaluetypes.c
parent1d5b01bb5286277859d354a46c99fcee0a56113a (diff)
removed archaic gpointer derived_data; relict and added a GData member
Wed Mar 14 18:46:54 2001 Tim Janik <timj@gtk.org> * gscanner.[hc]: removed archaic gpointer derived_data; relict and added a GData member instead. * glist.[hc]: added g_list_remove_all(). * gslist.[hc]: added g_slist_remove_all(). Sat Mar 17 23:18:36 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_property): minor bug-fix. * gbsearcharray.[hc]: provide a macro for static initialization and functions g_bsearch_array_new() and g_bsearch_array_destroy() for dynamic allocations. * gboxed.c: introduce G_TYPE_GSTRING, boxed type for GString. * gclosure.[hc]: naming corrections. Fri Mar 9 16:42:08 2001 Tim Janik <timj@gtk.org> * gvaluetypes.[hc]: moved g_strdup_value_contents() into this file as a public function (was static in gobject.c before). it's a bit odd to have that function here, especially since it requires extra includes, but then it doesn't very well fit somewhere else either. * gparamspecs.c: added default/max/min checks to param spec creation functions.
Diffstat (limited to 'gobject/gvaluetypes.c')
-rw-r--r--gobject/gvaluetypes.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gobject/gvaluetypes.c b/gobject/gvaluetypes.c
index 0391c89f6..dde820b64 100644
--- a/gobject/gvaluetypes.c
+++ b/gobject/gvaluetypes.c
@@ -462,7 +462,7 @@ g_value_types_init (void) /* sync with gtype.c */
value_lcopy_string, /* lcopy_value */
};
info.value_table = &value_table;
- type = g_type_register_fundamental (G_TYPE_STRING, "gstring", &info, &finfo, 0);
+ type = g_type_register_fundamental (G_TYPE_STRING, "gchararray", &info, &finfo, 0);
g_assert (type == G_TYPE_STRING);
}
@@ -743,19 +743,19 @@ g_strdup_value_contents (const GValue *value)
else if (g_value_type_transformable (G_VALUE_TYPE (value), G_TYPE_STRING))
{
GValue tmp_value = { 0, };
-
+ gchar *s;
+
g_value_init (&tmp_value, G_TYPE_STRING);
g_value_transform (value, &tmp_value);
+ s = g_strescape (g_value_get_string (&tmp_value), NULL);
+ g_value_unset (&tmp_value);
if (G_VALUE_HOLDS_ENUM (value) || G_VALUE_HOLDS_FLAGS (value))
contents = g_strdup_printf ("((%s) %s)",
g_type_name (G_VALUE_TYPE (value)),
- g_value_get_string (&tmp_value));
+ s);
else
- {
- src = g_value_get_string (&tmp_value);
- contents = g_strdup (src ? src : "NULL");
- }
- g_value_unset (&tmp_value);
+ contents = g_strdup (s ? s : "NULL");
+ g_free (s);
}
else if (g_value_fits_pointer (value))
{