Krolyxon
Commit ac1300a

Branches

Refs →

nsxivac1300a

Fixed issue #25: invalid file cnt and sel in thumb mode

Author
Bert Münnich
Date
2011-10-31 11:46 +0100
Parent
1cdbeb9
Commit
ac1300ae0043ecca645c9af54130a229727860fa

+5 −2

2 files changed

  1. M Makefile +1 −1
  2. M commands.c +4 −1
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20111027
1+VERSION = git-20111031
22
33 CC = gcc
44 CFLAGS = -ansi -Wall -pedantic -O2
M commands.c View
@@ -69,7 +69,10 @@ bool it_switch_mode(arg_t a) {
6969 img.slideshow = false;
7070 reset_timeout(slideshow);
7171 }
72− tns.sel = fileidx;
72+ if (fileidx < tns.cnt)
73+ tns.sel = fileidx;
74+ else
75+ tns.sel = tns.cnt > 0 ? tns.cnt - 1 : 0;
7376 tns.dirty = true;
7477 mode = MODE_THUMB;
7578 } else {