nsxivac1300a
Fixed issue #25: invalid file cnt and sel in thumb mode
+5 −2
2 files changed
- M Makefile +1 −1
- M commands.c +4 −1
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20111027 | |
| 1 | + | VERSION = git-20111031 | |
| 2 | 2 | ||
| 3 | 3 | CC = gcc | |
| 4 | 4 | CFLAGS = -ansi -Wall -pedantic -O2 | |
| @@ -69,7 +69,10 @@ bool it_switch_mode(arg_t a) { | |||
| 69 | 69 | img.slideshow = false; | |
| 70 | 70 | reset_timeout(slideshow); | |
| 71 | 71 | } | |
| 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; | |
| 73 | 76 | tns.dirty = true; | |
| 74 | 77 | mode = MODE_THUMB; | |
| 75 | 78 | } else { | |