errr. why didnt this get committed? commit.

SVN revision: 63721
This commit is contained in:
Carsten Haitzler 2011-09-30 08:48:25 +00:00
parent 7efb904984
commit 1cdb29aa35
1 changed files with 9 additions and 4 deletions

View File

@ -789,7 +789,7 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
{ {
Ecore_X_Selection_Data *data; Ecore_X_Selection_Data *data;
Ecore_X_Selection_Data_Files *files; Ecore_X_Selection_Data_Files *files;
char *p; char *p, *stripstr;
data = notify->data; data = notify->data;
cnp_debug("data->format is %d %p %p\n", data->format, notify, data); cnp_debug("data->format is %d %p %p\n", data->format, notify, data);
@ -803,11 +803,11 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
cnp_debug("more then one file: Bailing\n"); cnp_debug("more then one file: Bailing\n");
return 0; return 0;
} }
p = files->files[0]; stripstr = p = strdup(files->files[0]);
} }
else else
{ {
p = (char *)data->data; stripstr = p = strndup((char *)data->data, data->length);
} }
if (!p) if (!p)
@ -819,7 +819,11 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
if (strncmp(p, "file://", 7)) if (strncmp(p, "file://", 7))
{ {
/* Try and continue if it looks sane */ /* Try and continue if it looks sane */
if (*p != '/') return 0; if (*p != '/')
{
free(p);
return 0;
}
} }
else else
{ {
@ -836,6 +840,7 @@ notify_handler_uri(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
{ {
pasteimage_append(p, sel->requestwidget); pasteimage_append(p, sel->requestwidget);
} }
free(stripstr);
return 0; return 0;
} }