X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=terminal.c;h=54f86f8630a80cee77305d8bf99d755f34d43fb9;hb=69303f2d3e815470863808456be37f55947c9522;hp=aa2319628147945810b27509d773aded101d90ce;hpb=e4e10e494b3ee80e68c84882628d84c2791b1344;p=PuTTY.git diff --git a/terminal.c b/terminal.c index aa231962..54f86f86 100644 --- a/terminal.c +++ b/terminal.c @@ -4337,7 +4337,8 @@ static void term_out(Terminal *term) } term_print_flush(term); - logflush(term->logctx); + if (term->cfg.logflush) + logflush(term->logctx); } /* @@ -4371,7 +4372,7 @@ static int term_bidi_cache_hit(Terminal *term, int line, static void term_bidi_cache_store(Terminal *term, int line, termchar *lbefore, termchar *lafter, bidi_char *wcTo, - int width) + int width, int size) { int i; @@ -4389,22 +4390,28 @@ static void term_bidi_cache_store(Terminal *term, int line, termchar *lbefore, term->post_bidi_cache[j].chars = NULL; term->pre_bidi_cache[j].width = term->post_bidi_cache[j].width = -1; + term->pre_bidi_cache[j].forward = + term->post_bidi_cache[j].forward = NULL; + term->pre_bidi_cache[j].backward = + term->post_bidi_cache[j].backward = NULL; j++; } } sfree(term->pre_bidi_cache[line].chars); sfree(term->post_bidi_cache[line].chars); + sfree(term->post_bidi_cache[line].forward); + sfree(term->post_bidi_cache[line].backward); term->pre_bidi_cache[line].width = width; - term->pre_bidi_cache[line].chars = snewn(width, termchar); + term->pre_bidi_cache[line].chars = snewn(size, termchar); term->post_bidi_cache[line].width = width; - term->post_bidi_cache[line].chars = snewn(width, termchar); + term->post_bidi_cache[line].chars = snewn(size, termchar); term->post_bidi_cache[line].forward = snewn(width, int); term->post_bidi_cache[line].backward = snewn(width, int); - memcpy(term->pre_bidi_cache[line].chars, lbefore, width * TSIZE); - memcpy(term->post_bidi_cache[line].chars, lafter, width * TSIZE); + memcpy(term->pre_bidi_cache[line].chars, lbefore, size * TSIZE); + memcpy(term->post_bidi_cache[line].chars, lafter, size * TSIZE); memset(term->post_bidi_cache[line].forward, 0, width * sizeof(int)); memset(term->post_bidi_cache[line].backward, 0, width * sizeof(int)); @@ -4506,7 +4513,8 @@ static termchar *term_bidi_line(Terminal *term, struct termline *ldata, term->ltemp[it].chr = term->wcTo[it].wc; } term_bidi_cache_store(term, scr_y, ldata->chars, - term->ltemp, term->wcTo, ldata->size); + term->ltemp, term->wcTo, + term->cols, ldata->size); lchars = term->ltemp; } else {