forked from enlightenment/efl
parent
e13146588e
commit
2eca3bd0d2
|
@ -626,8 +626,8 @@ _ecore_x_selection_parser_files(const char *target, unsigned char *data, int siz
|
||||||
int i, is;
|
int i, is;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
if (strcmp(target, "text/uri-list")
|
if (strcmp(target, "text/uri-list") &&
|
||||||
&& strcmp(target, "_NETSCAPE_URL"))
|
strcmp(target, "_NETSCAPE_URL"))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
sel = calloc(1, sizeof(Ecore_X_Selection_Data_Files));
|
sel = calloc(1, sizeof(Ecore_X_Selection_Data_Files));
|
||||||
|
@ -636,7 +636,6 @@ _ecore_x_selection_parser_files(const char *target, unsigned char *data, int siz
|
||||||
if (data[size - 1])
|
if (data[size - 1])
|
||||||
{
|
{
|
||||||
/* Isn't nul terminated */
|
/* Isn't nul terminated */
|
||||||
printf("BUG: isn't nul terminated!\n");
|
|
||||||
size++;
|
size++;
|
||||||
data = realloc(data, size);
|
data = realloc(data, size);
|
||||||
data[size - 1] = 0;
|
data[size - 1] = 0;
|
||||||
|
@ -653,16 +652,14 @@ _ecore_x_selection_parser_files(const char *target, unsigned char *data, int siz
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((data[is] != '\r')
|
if ((data[is] != '\r') &&
|
||||||
&& (data[is] != '\n'))
|
(data[is] != '\n'))
|
||||||
{
|
{
|
||||||
tmp[i++] = data[is++];
|
tmp[i++] = data[is++];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while ((data[is] == '\r')
|
while ((data[is] == '\r') || (data[is] == '\n')) is++;
|
||||||
|| (data[is] == '\n'))
|
|
||||||
is++;
|
|
||||||
tmp[i] = 0;
|
tmp[i] = 0;
|
||||||
sel->num_files++;
|
sel->num_files++;
|
||||||
sel->files = realloc(sel->files, sel->num_files * sizeof(char *));
|
sel->files = realloc(sel->files, sel->num_files * sizeof(char *));
|
||||||
|
@ -712,7 +709,6 @@ _ecore_x_selection_parser_text(const char *target __UNUSED__, unsigned char *dat
|
||||||
if (data[size - 1])
|
if (data[size - 1])
|
||||||
{
|
{
|
||||||
/* Isn't nul terminated */
|
/* Isn't nul terminated */
|
||||||
printf("BUG: isn't nul terminated!\n");
|
|
||||||
size++;
|
size++;
|
||||||
data = realloc(data, size);
|
data = realloc(data, size);
|
||||||
data[size - 1] = 0;
|
data[size - 1] = 0;
|
||||||
|
|
Loading…
Reference in New Issue