~mcf/mupdf

475129d6b181a9b17ec08bca70a1ac03e42e3b2b — Robin Watts 8 months ago e27ceb2
Fix MuPDF-gl chapter/page handling.

Internally, fz_locations are numbered from 0. Externally we number from
1. Adjust when parsing.
1 files changed, 3 insertions(+), 3 deletions(-)

M platform/gl/gl-main.c
M platform/gl/gl-main.c => platform/gl/gl-main.c +3 -3
@@ 1472,16 1472,16 @@ parse_location(const char *anchor, fz_location *loc)
	s = anchor;
	while (*s >= '0' && *s <= '9')
		s++;
	loc->chapter = fz_atoi(anchor);
	loc->chapter = fz_atoi(anchor)-1;
	if (*s != ':')
		return 0;
	p = ++s;
	while (*s >= '0' && *s <= '9')
		s++;
	if (s == p)
		loc->page = 1;
		loc->page = 0;
	else
		loc->page = atoi(p);
		loc->page = fz_atoi(p)-1;

	return 1;
}