freeline(line);
}
+#ifdef TERM_CC_DIAGS
/*
* Diagnostic function: verify that a termline has a correct
* combining character structure.
*
- * XXX-REMOVE-BEFORE-RELEASE: This is a performance-intensive
- * check. Although it's currently really useful for getting all the
- * bugs out of the new cc stuff, it will want to be absent when we
- * make a proper release.
+ * This is a performance-intensive check, so it's no longer enabled
+ * by default.
*/
static void cc_check(termline *line)
{
sfree(flags);
}
+#endif
/*
* Add a combining character to a character cell.
line->chars[newcc].chr = chr;
line->chars[col].cc_next = newcc - col;
- cc_check(line); /* XXX-REMOVE-BEFORE-RELEASE */
+#ifdef TERM_CC_DIAGS
+ cc_check(line);
+#endif
}
/*
line->chars[origcol].cc_next = 0;
- cc_check(line); /* XXX-REMOVE-BEFORE-RELEASE */
+#ifdef TERM_CC_DIAGS
+ cc_check(line);
+#endif
}
/*
add_cc(destline, x, src->chr);
}
- cc_check(destline); /* XXX-REMOVE-BEFORE-RELEASE */
+#ifdef TERM_CC_DIAGS
+ cc_check(destline);
+#endif
}
/*
/* Ensure the original cell doesn't have a cc list. */
src->cc_next = 0;
- cc_check(line); /* XXX-REMOVE-BEFORE-RELEASE */
+#ifdef TERM_CC_DIAGS
+ cc_check(line);
+#endif
}
/*
* Diagnostics: ensure that the compressed data really does
* decompress to the right thing.
*
- * XXX-REMOVE-BEFORE-RELEASE: This is a bit performance-heavy
- * to be leaving in production code.
+ * This is a bit performance-heavy for production code.
*/
+#ifdef TERM_CC_DIAGS
#ifndef CHECK_SB_COMPRESSION
{
int dused;
freeline(dcl);
}
#endif
+#endif /* TERM_CC_DIAGS */
/*
* Trim the allocated memory so we don't waste any, and return.
for (i = oldcols; i < cols; i++)
line->chars[i] = term->basic_erase_char;
- cc_check(line); /* XXX-REMOVE-BEFORE-RELEASE */
+#ifdef TERM_CC_DIAGS
+ cc_check(line);
+#endif
}
}
}
/* We assume that we don't screw up and retrieve something out of range. */
+ if (line == NULL) {
+ fatalbox("line==NULL in terminal.c\n"
+ "lineno=%d y=%d w=%d h=%d\n"
+ "count(scrollback=%p)=%d\n"
+ "count(screen=%p)=%d\n"
+ "count(alt=%p)=%d alt_sblines=%d\n"
+ "whichtree=%p treeindex=%d\n\n"
+ "Please contact <putty@projects.tartarus.org> "
+ "and pass on the above information.",
+ lineno, y, term->cols, term->rows,
+ term->scrollback, count234(term->scrollback),
+ term->screen, count234(term->screen),
+ term->alt_screen, count234(term->alt_screen), term->alt_sblines,
+ whichtree, treeindex);
+ }
assert(line != NULL);
resizeline(term, line, term->cols);
} else {
while (lines > 0) {
line = delpos234(term->screen, topline);
- cc_check(line); /* XXX-REMOVE-BEFORE-RELEASE */
+#ifdef TERM_CC_DIAGS
+ cc_check(line);
+#endif
if (sb && term->savelines > 0) {
int sblen = count234(term->scrollback);
/*
if (DIRECT_CHAR(c))
width = 1;
if (!width)
- width = wcwidth((wchar_t) c);
+ width = (term->cfg.cjk_ambig_wide ?
+ mk_wcwidth_cjk((wchar_t) c) :
+ mk_wcwidth((wchar_t) c));
if (term->wrapnext && term->wrap && width > 0) {
cline->lattr |= LATTR_WRAPPED;
* the remote side needing to wait until term_out() has cleared
* a backlog.
*
- * This is a slightly suboptimal way to deal with SSH2 - in
+ * This is a slightly suboptimal way to deal with SSH-2 - in
* principle, the window mechanism would allow us to continue
* to accept data on forwarded ports and X connections even
* while the terminal processing was going slowly - but we
* can't do the 100% right thing without moving the terminal
* processing into a separate thread, and that might hurt
- * portability. So we manage stdout buffering the old SSH1 way:
+ * portability. So we manage stdout buffering the old SSH-1 way:
* if the terminal processing goes slowly, the whole SSH
* connection stops accepting data until it's ready.
*