summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2019-11-17 06:03:49 +0100
committerKim Woelders <kim@woelders.dk>2019-11-17 06:13:14 +0100
commitbaaddf9366aea48bbdf26b9191f538f895e79fba (patch)
treec82528ad5f5df508251d31e2732b03bffee4dddf
parent1a6a6b6433f8af374ab26d1fe0fcb70c670675ac (diff)
downloadimlib2-baaddf9366aea48bbdf26b9191f538f895e79fba.tar.gz
imlib2_view: Fix next/prev selection if last/first image is bad
-rw-r--r--src/bin/imlib2_view.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/imlib2_view.c b/src/bin/imlib2_view.c
index d98da4a..26f5dec 100644
--- a/src/bin/imlib2_view.c
+++ b/src/bin/imlib2_view.c
@@ -326,9 +326,15 @@ main(int argc, char **argv)
{
no += inc;
if (no >= argc)
- no = argc - 1;
- else if (no <= 0)
- no = 0;
+ {
+ inc = -1;
+ continue;
+ }
+ else if (no < 0)
+ {
+ inc = 1;
+ continue;
+ }
file = argv[no];
if (verbose)
printf("Show %d: '%s'\n", no, file);