summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-03-31 05:11:15 -0700
committerStefano Karapetsas <[email protected]>2013-03-31 05:11:15 -0700
commitc94e55cabfe217ad2b609e33bb57e5d5838bd5ef (patch)
treedadc043d7c158136aeb204e7b14f31c473d1e20f /src
parent19da01b11830015657c83235a48934a78b693990 (diff)
parent4421eb314b10868707bea9f3375ff61a174f4b2b (diff)
downloadengrampa-c94e55cabfe217ad2b609e33bb57e5d5838bd5ef.tar.bz2
engrampa-c94e55cabfe217ad2b609e33bb57e5d5838bd5ef.tar.xz
Merge pull request #15 from Salz/master
Directory name in drag'n'drop extraction sometimes garbeled
Diffstat (limited to 'src')
-rw-r--r--src/fr-window.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/fr-window.c b/src/fr-window.c
index 7ac8a2d..0b36aea 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -4195,6 +4195,8 @@ file_list_drag_end (GtkWidget *widget,
static char *
get_xds_atom_value (GdkDragContext *context)
{
+ gint actual_length;
+ char *data;
char *ret;
g_return_val_if_fail (context != NULL, NULL);
@@ -4203,9 +4205,13 @@ get_xds_atom_value (GdkDragContext *context)
if (gdk_property_get (gdk_drag_context_get_source_window (context),
XDS_ATOM, TEXT_ATOM,
0, MAX_XDS_ATOM_VAL_LEN,
- FALSE, NULL, NULL, NULL,
- (unsigned char **) &ret))
+ FALSE, NULL, NULL, &actual_length,
+ (unsigned char **) &data)) {
+ /* add not included \0 to the end of the string */
+ ret = g_strndup ((gchar *) data, actual_length);
+ g_free (data);
return ret;
+ }
return NULL;
}