Fix typo in term_size(), flagged by a Dr Watson log from Temme Rainer.
[u/mdw/putty] / terminal.c
index 40ad482..f8d92dc 100644 (file)
@@ -435,6 +435,9 @@ static void makerle(struct buf *b, termline *ldata,
                hdrpos = b->len;
                hdrsize = 0;
                add(b, 0);
+               /* And ensure this run doesn't interfere with the next. */
+               prevlen = prevpos = 0;
+               prev2 = FALSE;
 
                continue;
            } else {
@@ -1430,7 +1433,7 @@ void term_size(Terminal *term, int newrows, int newcols, int newsavelines)
     for (i = 0; i < newrows; i++) {
        newdisp[i] = newline(term, newcols, FALSE);
        for (j = 0; j < newcols; j++)
-           newdisp[i]->chars[i].attr = ATTR_INVALID;
+           newdisp[i]->chars[j].attr = ATTR_INVALID;
     }
     if (term->disptext) {
        for (i = 0; i < oldrows; i++)
@@ -4444,6 +4447,10 @@ static void do_paint(Terminal *term, Context ctx, int may_optimise)
            tchar = d->chr;
            tattr = d->attr;
 
+            if (!term->cfg.ansi_colour)
+                tattr = (tattr & ~(ATTR_FGMASK | ATTR_BGMASK)) | 
+                ATTR_DEFFG | ATTR_DEFBG;
+
            switch (tchar & CSET_MASK) {
              case CSET_ASCII:
                tchar = term->ucsdata->unitab_line[tchar & 0xFF];