From 53735a8b33019251701f4522ec858d9e6c4f02d2 Mon Sep 17 00:00:00 2001 From: Steven Dee Date: Wed, 12 Feb 2014 01:00:44 +0000 Subject: [PATCH] Fixes to our hi/lojack logic This doesn't actually fix the prompt-eating bug, but it sure looks like it ought to, doesn't it? --- v/loop.c | 25 +++++++++++++------------ v/term.c | 4 +++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/v/loop.c b/v/loop.c index d6e19b4d0..2fbb8f161 100644 --- a/v/loop.c +++ b/v/loop.c @@ -1942,30 +1942,30 @@ _lo_mark() return siz_w; } -/* _lo_word(): print a word to stderr. +/* _lo_word(): print a word to the passed stream. */ static void -_lo_word(c3_w wod_w) +_lo_word(FILE* fil_u, c3_w wod_w) { u2_bean top = u2_yes; if ( wod_w / (1000 * 1000 * 1000) ) { - uL(fprintf(uH, "%u.", wod_w / (1000 * 1000 * 1000))); + fprintf(fil_u, "%u.", wod_w / (1000 * 1000 * 1000)); wod_w %= (1000 * 1000 * 1000); top = u2_no; } if ( wod_w / (1000 * 1000) ) { - uL(fprintf(uH, ((top == u2_yes) ? "%u." : "%03u."), - wod_w / (1000 * 1000))); + fprintf(fil_u, ((top == u2_yes) ? "%u." : "%03u."), + wod_w / (1000 * 1000)); wod_w %= (1000 * 1000); top = u2_no; } if ( wod_w / 1000 ) { - uL(fprintf(uH, ((top == u2_yes) ? "%u." : "%03u."), wod_w / 1000)); + fprintf(fil_u, ((top == u2_yes) ? "%u." : "%03u."), wod_w / 1000); wod_w %= 1000; top = u2_no; } - uL(fprintf(uH, ((top == u2_yes) ? "%u" : "%03u"), wod_w)); + fprintf(fil_u, ((top == u2_yes) ? "%u" : "%03u"), wod_w); } /* u2_lo_grab(): garbage-collect the world, plus roots. @@ -1995,13 +1995,14 @@ u2_lo_grab(c3_c* cap_c, u2_noun som, ...) // if ( lec_w || (u2_yes == u2_Flag_Verbose) ) if ( lec_w || !strcmp("init", cap_c) ) { - uL(fprintf(uH, "%s: gc: ", cap_c)); + FILE* fil_u = uH; + fprintf(fil_u, "%s: gc: ", cap_c); if ( lec_w ) { - _lo_word(4 * lec_w); - uL(fprintf(uH, " bytes shed; ")); + _lo_word(fil_u, 4 * lec_w); + fprintf(fil_u, " bytes shed; "); } - _lo_word(4 * siz_w); - uL(fprintf(uH, " bytes live\n")); + _lo_word(fil_u, 4 * siz_w); + uL(fprintf(fil_u, " bytes live\n")); #if 0 if ( lec_w ) { diff --git a/v/term.c b/v/term.c index 8446f6642..77e5797d2 100644 --- a/v/term.c +++ b/v/term.c @@ -491,8 +491,10 @@ _term_it_show_line(u2_utty* uty_u, c3_w* lin_w, c3_w len_w) static void _term_it_refresh_line(u2_utty* uty_u) { + c3_w len_w = uty_u->tat_u.mir.len_w; + _term_it_show_clear(uty_u); - _term_it_show_wide(uty_u, uty_u->tat_u.mir.len_w, uty_u->tat_u.mir.lin_w); + _term_it_show_wide(uty_u, len_w, uty_u->tat_u.mir.lin_w); } /* _term_it_show_more(): new current line.