-/* $OpenBSD: wsemul_sun.c,v 1.35 2023/03/06 17:14:44 miod Exp $ */
+/* $OpenBSD: wsemul_sun.c,v 1.36 2023/03/06 20:34:35 miod Exp $ */
/* $NetBSD: wsemul_sun.c,v 1.11 2000/01/05 11:19:36 drochner Exp $ */
/*
{
struct wsemul_sun_emuldata *edp = cookie;
struct wsemul_inputstate *instate;
- u_int processed = 0;
+ u_int prev_count, processed = 0;
#ifdef HAVE_JUMP_SCROLL
int lines;
#endif
case ABORT_FAILED_CURSOR:
/*
* If we could not display the cursor back, we pretended not
- * having been able to display the last character. But this
+ * having been able to process the last byte. But this
* is a lie, so compensate here.
*/
data++, count--;
wsemul_resume_abort(&edp->abortstate);
+ prev_count = count;
if (wsemul_getchar(&data, &count, instate,
#ifdef HAVE_UTF8_SUPPORT
(edp->state == SUN_EMUL_STATE_NORMAL && !kernel) ?
rc = wsemul_sun_output_lowchars(edp, instate, kernel);
if (rc != 0)
break;
- processed++;
+ processed += prev_count - count;
continue;
}
rc = wsemul_sun_output_normal(edp, instate, 1);
if (rc != 0)
break;
- processed++;
+ processed += prev_count - count;
continue;
}
}
if (rc != 0)
break;
- processed++;
+ processed += prev_count - count;
}
if (rc != 0)
(edp->emulcookie, 1, edp->crow, edp->ccol);
if (rc != 0) {
/*
- * Fail the last character output, remembering that
- * only the cursor operation really needs to be done.
+ * Pretend the last byte hasn't been processed, while
+ * remembering that only the cursor operation really
+ * needs to be done.
*/
wsemul_abort_cursor(&edp->abortstate);
processed--;
-/* $OpenBSD: wsemul_vt100.c,v 1.44 2023/03/06 17:14:44 miod Exp $ */
+/* $OpenBSD: wsemul_vt100.c,v 1.45 2023/03/06 20:34:35 miod Exp $ */
/* $NetBSD: wsemul_vt100.c,v 1.13 2000/04/28 21:56:16 mycroft Exp $ */
/*
{
struct wsemul_vt100_emuldata *edp = cookie;
struct wsemul_inputstate *instate;
- u_int processed = 0;
+ u_int prev_count, processed = 0;
#ifdef HAVE_JUMP_SCROLL
int lines;
#endif
case ABORT_FAILED_CURSOR:
/*
* If we could not display the cursor back, we pretended not
- * having been able to display the last character. But this
+ * having been able to process the last byte. But this
* is a lie, so compensate here.
*/
data++, count--;
wsemul_resume_abort(&edp->abortstate);
+ prev_count = count;
if (wsemul_getchar(&data, &count, instate,
#ifdef HAVE_UTF8_SUPPORT
(edp->state == VT100_EMUL_STATE_NORMAL && !kernel) ?
rc = wsemul_vt100_output_c0c1(edp, instate, kernel);
if (rc != 0)
break;
- processed++;
+ processed += prev_count - count;
continue;
}
rc = wsemul_vt100_output_normal(edp, instate, kernel);
if (rc != 0)
break;
- processed++;
+ processed += prev_count - count;
continue;
}
#ifdef DIAGNOSTIC
rc = vt100_output[edp->state - 1](edp, instate);
if (rc != 0)
break;
- processed++;
+ processed += prev_count - count;
}
if (rc != 0)
#endif
if (rc != 0) {
/*
- * Fail the last character output, remembering
- * that only the cursor operation really needs
- * to be done.
+ * Pretend the last byte hasn't been processed,
+ * while remembering that only the cursor
+ * operation really needs to be done.
*/
wsemul_abort_cursor(&edp->abortstate);
processed--;