X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/7c66d7d9a4f1a148751d27e2f2a1757a9caa44a1..2dc6356a02ebe2e5c0428cefc18e64882d85b4a6:/terminal.c?ds=inline diff --git a/terminal.c b/terminal.c index 06d6ee6b..749b1203 100644 --- a/terminal.c +++ b/terminal.c @@ -62,6 +62,8 @@ const wchar_t sel_nl[] = SEL_NL; /* * Internal prototypes. */ +static unsigned long *resizeline(unsigned long *, int); +static unsigned long *lineptr(Terminal *, int, int); static void do_paint(Terminal *, Context, int); static void erase_lots(Terminal *, int, int, int); static void swap_screen(Terminal *, int, int, int); @@ -75,7 +77,7 @@ static void scroll_display(Terminal *, int, int, int); /* * Resize a line to make it `cols' columns wide. */ -unsigned long *resizeline(unsigned long *line, int cols) +static unsigned long *resizeline(unsigned long *line, int cols) { int i, oldlen; unsigned long lineattrs; @@ -102,7 +104,7 @@ unsigned long *resizeline(unsigned long *line, int cols) * whether the y coordinate is non-negative or negative * (respectively). */ -unsigned long *lineptr(Terminal *term, int y, int lineno) +static unsigned long *lineptr(Terminal *term, int y, int lineno) { unsigned long *line, *newline; tree234 *whichtree; @@ -336,6 +338,7 @@ Terminal *term_init(Config *mycfg, void *frontend) term->nbeeps = 0; term->lastbeep = FALSE; term->beep_overloaded = FALSE; + term->attr_mask = 0xffffffff; term->resize_fn = NULL; term->resize_ctx = NULL; @@ -1271,7 +1274,7 @@ void term_out(Terminal *term) else if(term->sco_acs && (c!='\033' && c!='\012' && c!='\015' && c!='\b')) { - if (term->sco_acs == 2) c ^= 0x80; + if (term->sco_acs == 2) c |= 0x80; c |= ATTR_SCOACS; } else { switch (term->cset_attr[term->cset]) { @@ -1539,7 +1542,6 @@ void term_out(Terminal *term) term->logctx) logtraffic(term->logctx, (unsigned char) c, LGTYP_ASCII); { - extern int wcwidth(wchar_t ucs); int width = 0; if (DIRECT_CHAR(c)) width = 1; @@ -2101,7 +2103,7 @@ void term_out(Terminal *term) compatibility(SCOANSI); if (term->cfg->no_remote_charset) break; term->sco_acs = 1; break; - case 12: /* SCO acs on flipped */ + case 12: /* SCO acs on, |0x80 */ compatibility(SCOANSI); if (term->cfg->no_remote_charset) break; term->sco_acs = 2; break; @@ -3039,7 +3041,8 @@ static void do_paint(Terminal *term, Context ctx, int may_optimise) if ((term->disptext[idx] ^ tattr) & ATTR_WIDE) dirty_line = TRUE; - break_run = (tattr != attr || j - start >= sizeof(ch)); + break_run = (((tattr ^ attr) & term->attr_mask) || + j - start >= sizeof(ch)); /* Special hack for VT100 Linedraw glyphs */ if ((attr & CSET_MASK) == 0x2300 && tchar >= 0xBA @@ -3307,7 +3310,7 @@ static void clipme(Terminal *term, pos top, pos bottom, int rect) int rv; if (is_dbcs_leadbyte(font_codepage, (BYTE) c)) { buf[0] = c; - buf[1] = ldata[top.x + 1]; + buf[1] = (char) (0xFF & ldata[top.x + 1]); rv = mb_to_wc(font_codepage, 0, buf, 2, wbuf, 4); top.x++; } else {