1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

Extra diagnostics in the hope that we can track down the problem with

the nightlies. I must remember to take it all out again when we do!

[originally from svn r1095]
This commit is contained in:
Simon Tatham 2001-05-02 14:45:25 +00:00
parent 463c2651ae
commit 56a5e6fdf3
2 changed files with 14 additions and 1 deletions

View File

@ -350,6 +350,9 @@ void term_size(int newrows, int newcols, int newsavelines) {
alt_t = marg_t = 0; alt_t = marg_t = 0;
alt_b = marg_b = newrows - 1; alt_b = marg_b = newrows - 1;
debug(("term_size, old r,c,s (%d,%d,%d), new rcs (%d,%d,%d)\n",
rows, cols, savelines, newrows, newcols, newsavelines));
if (rows == -1) { if (rows == -1) {
scrollback = newtree234(NULL); scrollback = newtree234(NULL);
screen = newtree234(NULL); screen = newtree234(NULL);
@ -377,22 +380,31 @@ void term_size(int newrows, int newcols, int newsavelines) {
* away. * away.
*/ */
sblen = count234(scrollback); sblen = count234(scrollback);
debug(("newrows=%d rows=%d sblen=%d\n", newrows, rows, sblen));
if (newrows > rows) { if (newrows > rows) {
for (i = rows; i < newrows; i++) { for (i = rows; i < newrows; i++) {
debug(("increase screen: i=%d\n", i));
if (sblen > 0) { if (sblen > 0) {
debug(("sblen=%d so use line from scrollback\n", sblen));
line = delpos234(scrollback, --sblen); line = delpos234(scrollback, --sblen);
} else { } else {
debug(("sblen=%d so make up a new line\n", sblen));
line = smalloc(TSIZE * (newcols+2)); line = smalloc(TSIZE * (newcols+2));
line[0] = newcols; line[0] = newcols;
for (j = 0; j <= newcols; j++) for (j = 0; j <= newcols; j++)
line[j+1] = ERASE_CHAR; line[j+1] = ERASE_CHAR;
} }
debug(("got new screen line %p\n", line));
addpos234(screen, line, 0); addpos234(screen, line, 0);
} }
} else if (newrows < rows) { } else if (newrows < rows) {
for (i = newrows; i < rows; i++) { for (i = newrows; i < rows; i++) {
debug(("decrease screen: i=%d\n", i));
line = delpos234(screen, 0); line = delpos234(screen, 0);
debug(("taken out line %p, count is now %d\n",
line, count234(screen)));
addpos234(scrollback, line, sblen++); addpos234(scrollback, line, sblen++);
debug(("added to scrollback, sblen is now %d\n", sblen));
} }
} }
assert(count234(screen) == newrows); assert(count234(screen) == newrows);

View File

@ -39,7 +39,8 @@
#ifdef TEST #ifdef TEST
#define LOG(x) (printf x) #define LOG(x) (printf x)
#else #else
#define LOG(x) // FIXME
#define LOG(x) (dprintf x)
#endif #endif
typedef struct node234_Tag node234; typedef struct node234_Tag node234;