From 8b79bc33f37db12cbb672bdb47dcfeb0f2030bce Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 31 Aug 2011 16:51:58 +0200 Subject: feh_reload_image: Always die if reload failed This fixes a segfault in --reload when the image becomes unloadable while feh is running. Note that this does not affect --reload with more than one file: If the current image is removed, feh will simply jump to the next image. feh will only quit if the file still exists, but can no longer be loaded. --- src/keyevents.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/keyevents.c') diff --git a/src/keyevents.c b/src/keyevents.c index 60663db..8e6e3f6 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -333,7 +333,7 @@ void feh_event_invoke_action(winwidget winwid, unsigned char action) feh_action_run(FEH_FILE(winwid->file->data), opt.actions[action]); if (opt.hold_actions[action]) - feh_reload_image(winwid, 1, 1); + feh_reload_image(winwid, 1); else slideshow_change_image(winwid, SLIDE_NEXT, 1); @@ -342,7 +342,7 @@ void feh_event_invoke_action(winwidget winwid, unsigned char action) feh_action_run(FEH_FILE(winwid->file->data), opt.actions[action]); if (opt.hold_actions[action]) - feh_reload_image(winwid, 1, 1); + feh_reload_image(winwid, 1); else winwidget_destroy(winwid); } else if (winwid->type == WIN_TYPE_THUMBNAIL) @@ -630,7 +630,7 @@ void feh_event_handle_keypress(XEvent * ev) winwidget_render_image(winwid, 0, 0); } else if (feh_is_kp(&keys.reload_image, keysym, state)) { - feh_reload_image(winwid, 0, 0); + feh_reload_image(winwid, 0); } else if (feh_is_kp(&keys.toggle_pause, keysym, state)) { slideshow_pause_toggle(winwid); -- cgit v1.2.3