Patch from 장효영 (Hyoyoung Chang). Basically checking extensions is silly,
and some real life use shows it just breaks things. Especially since we
aren't liberal enough with the extensions we check.
I also cleaned up some whitespace and weird indentation at the edges.
git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@58229
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
Ecore_X_Selection_Data *data;
Ecore_X_Selection_Data_Files *files;
Paste_Image *pi;
Ecore_X_Selection_Data *data;
Ecore_X_Selection_Data_Files *files;
Paste_Image *pi;
data = notify->data;
cnp_debug("data->format is %d %p %p\n", data->format, notify, data);
data = notify->data;
cnp_debug("data->format is %d %p %p\n", data->format, notify, data);
- else p = (char *)data->data;
+ else
+ {
+ p = (char *)data->data;
+ }
+
if (!p)
{
cnp_debug("Couldn't find a file\n");
if (!p)
{
cnp_debug("Couldn't find a file\n");
/* Try and continue if it looks sane */
if (*p != '/') return 0;
}
/* Try and continue if it looks sane */
if (*p != '/') return 0;
}
- else p += strlen("file://");
-
- ext = p + strlen(p);
- if (ext)
- Eina_Bool extok = EINA_FALSE;
- int i;
-
- for (i = 0; image_extensions[i]; i++)
- {
- pp = ext - strlen(image_extensions[i]);
- if ((pp >= p) && (!strcasecmp(pp, image_extensions[i])))
- {
- extok = EINA_TRUE;
- break;
- }
- }
- if (!extok)
- {
- cnp_debug("No known image format extension, ignoring\n");
- if (savedtypes.textreq) savedtypes.textreq = 0;
- return 0;
- }
+ p += strlen("file://");
}
if (savedtypes.pi) pasteimage_free(savedtypes.pi);
}
if (savedtypes.pi) pasteimage_free(savedtypes.pi);