Accept both \r\n and \n as file termination.

SVN revision: 13892
This commit is contained in:
sebastid 2005-03-24 20:52:27 +00:00 committed by sebastid
parent 7a3a3397ec
commit 5b4db3cfc2
1 changed files with 6 additions and 3 deletions

View File

@ -1116,12 +1116,16 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
} }
else else
{ {
if (data[is] != '\n') if ((data[is] != '\r')
&& (data[is] != '\n'))
{ {
tmp[i++] = data[is]; tmp[i++] = data[is++];
} }
else else
{ {
while ((data[is] == '\r')
|| (data[is] == '\n'))
is++;
tmp[i] = 0; tmp[i] = 0;
e->num_files++; e->num_files++;
e->files = realloc(e->files, e->num_files * sizeof(char *)); e->files = realloc(e->files, e->num_files * sizeof(char *));
@ -1129,7 +1133,6 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
tmp[0] = 0; tmp[0] = 0;
i = 0; i = 0;
} }
is++;
} }
} }
if (i > 0) if (i > 0)