diff options
author | Dennis Real <github@tildepipe.org> | 2012-03-16 19:13:47 +0100 |
---|---|---|
committer | Dennis Real <github@tildepipe.org> | 2012-03-16 19:13:47 +0100 |
commit | 8e96382805eb77a82209df9d71dbf9c0dd1c4cdb (patch) | |
tree | 48c54b9715d88cb6e9f8455d689364b73b842f8f /src/slideshow.c | |
parent | 77fa5aca182435f2771511832ea198d027393ceb (diff) | |
parent | 29cd868898660c58b1925bf3647c4c63b7bd3151 (diff) |
Merge branch 'master' of git://github.com/derf/feh
Diffstat (limited to 'src/slideshow.c')
-rw-r--r-- | src/slideshow.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index a868a44..337e202 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -76,8 +76,6 @@ void init_slideshow_mode(void) if (!success) show_mini_usage(); - setup_signal_handlers(); - return; } @@ -266,8 +264,11 @@ void slideshow_change_image(winwidget winwid, int change, int render) current_file = feh_list_jump(filelist, current_file, BACK, 1); break; case SLIDE_RAND: - current_file = feh_list_jump(filelist, current_file, FORWARD, rand() % filelist_len); - change = SLIDE_NEXT; + if (filelist_len > 1) { + current_file = feh_list_jump(filelist, current_file, FORWARD, + (rand() % (filelist_len - 1)) + 1); + change = SLIDE_NEXT; + } break; case SLIDE_JUMP_FWD: if (filelist_len < 5) |