imlib2_view: Fix next/prev selection if last/first image is bad

This commit is contained in:
Kim Woelders 2019-11-17 06:03:49 +01:00
parent 1a6a6b6433
commit baaddf9366
1 changed files with 9 additions and 3 deletions

View File

@ -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);