forked from enlightenment/enlightenment
fix bug when there is no file extension.
This was spotted by a segmentation faults on systems where sprintf() don't handle NULL as "%s" (Solaris, BSDs), but it makes no sense to lookup "*(null)" as extension on Linux either. Reported by: mcalamell SVN revision: 40120
This commit is contained in:
parent
cf1e0172cf
commit
9cc29ad360
|
@ -7659,7 +7659,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
|
||||||
E_Zone *zone;
|
E_Zone *zone;
|
||||||
Eina_List *sel, *l = NULL;
|
Eina_List *sel, *l = NULL;
|
||||||
int x, y, can_w, can_w2, protect;
|
int x, y, can_w, can_w2, protect;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX], *ext;
|
||||||
|
|
||||||
sd = ic->sd;
|
sd = ic->sd;
|
||||||
|
|
||||||
|
@ -7878,7 +7878,10 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* see if we have any glob handlers registered for this file */
|
/* see if we have any glob handlers registered for this file */
|
||||||
snprintf(buf, sizeof(buf), "*%s", strrchr(ic->info.file, '.'));
|
ext = strrchr(ic->info.file, '.');
|
||||||
|
if (ext)
|
||||||
|
{
|
||||||
|
snprintf(buf, sizeof(buf), "*%s", ext);
|
||||||
l = e_fm2_mime_handler_glob_handlers_get(buf);
|
l = e_fm2_mime_handler_glob_handlers_get(buf);
|
||||||
if (l)
|
if (l)
|
||||||
{
|
{
|
||||||
|
@ -7886,6 +7889,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
|
||||||
_e_fm2_context_menu_append(obj, buf, l, mn, ic);
|
_e_fm2_context_menu_append(obj, buf, l, mn, ic);
|
||||||
eina_list_free(l);
|
eina_list_free(l);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sd->icon_menu.end.func)
|
if (sd->icon_menu.end.func)
|
||||||
sd->icon_menu.end.func(sd->icon_menu.end.data, sd->obj, mn, &(ic->info));
|
sd->icon_menu.end.func(sd->icon_menu.end.data, sd->obj, mn, &(ic->info));
|
||||||
|
|
Loading…
Reference in New Issue