-/* $OpenBSD: mode-tree.c,v 1.70 2024/10/01 10:10:29 nicm Exp $ */
+/* $OpenBSD: mode-tree.c,v 1.71 2024/10/06 09:30:22 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
mtd->offset = 0;
return (1);
}
- mtd->current = 0;
- mtd->offset = 0;
+ if (mtd->current >= mtd->line_size) {
+ mtd->current = mtd->line_size - 1;
+ if (mtd->current > mtd->height - 1)
+ mtd->offset = mtd->current - mtd->height + 1;
+ else
+ mtd->offset = 0;
+ }
return (0);
}