aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-05-25 09:23:23 +0200
committerBert <ber.t@gmx.com>2011-05-25 09:23:23 +0200
commit2252a0148d11fc988131eb0bf6397453427d67e8 (patch)
tree7cb4e226e2405b420876709e033a8bcdffa8777c /main.c
parent00e6cd2bd1a7bfc0b9fcbf958cefee07ef41cb71 (diff)
downloadnsxiv-2252a0148d11fc988131eb0bf6397453427d67e8.tar.zst
New option: -n, start at given picture
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.c b/main.c
index 421d14f..344d55a 100644
--- a/main.c
+++ b/main.c
@@ -231,14 +231,14 @@ int main(int argc, char **argv) {
}
}
- filecnt = fileidx;
- fileidx = 0;
-
- if (!filecnt) {
+ if (!fileidx) {
fprintf(stderr, "sxiv: no valid image file given, aborting\n");
exit(1);
}
+ filecnt = fileidx;
+ fileidx = options->startnum < filecnt ? options->startnum : filecnt - 1;
+
win_init(&win);
img_init(&img, &win);