projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Windows's sk_address_is_local() was returning the wrong answers for
[u/mdw/putty]
/
terminal.c
diff --git
a/terminal.c
b/terminal.c
index
ed3563d
..
febd897
100644
(file)
--- a/
terminal.c
+++ b/
terminal.c
@@
-1065,32
+1065,32
@@
static termline *lineptr(Terminal *term, int y, int lineno, int screen)
static void term_schedule_tblink(Terminal *term);
static void term_schedule_cblink(Terminal *term);
static void term_schedule_tblink(Terminal *term);
static void term_schedule_cblink(Terminal *term);
-static void term_timer(void *ctx, long now)
+static void term_timer(void *ctx,
unsigned
long now)
{
Terminal *term = (Terminal *)ctx;
int update = FALSE;
{
Terminal *term = (Terminal *)ctx;
int update = FALSE;
- if (term->tblink_pending && now
- term->next_tblink >= 0
) {
+ if (term->tblink_pending && now
== term->next_tblink
) {
term->tblinker = !term->tblinker;
term->tblink_pending = FALSE;
term_schedule_tblink(term);
update = TRUE;
}
term->tblinker = !term->tblinker;
term->tblink_pending = FALSE;
term_schedule_tblink(term);
update = TRUE;
}
- if (term->cblink_pending && now
- term->next_cblink >= 0
) {
+ if (term->cblink_pending && now
== term->next_cblink
) {
term->cblinker = !term->cblinker;
term->cblink_pending = FALSE;
term_schedule_cblink(term);
update = TRUE;
}
term->cblinker = !term->cblinker;
term->cblink_pending = FALSE;
term_schedule_cblink(term);
update = TRUE;
}
- if (term->in_vbell && now
- term->vbell_end >= 0
) {
+ if (term->in_vbell && now
== term->vbell_end
) {
term->in_vbell = FALSE;
update = TRUE;
}
if (update ||
term->in_vbell = FALSE;
update = TRUE;
}
if (update ||
- (term->window_update_pending && now
- term->next_update >= 0
))
+ (term->window_update_pending && now
== term->next_update
))
term_update(term);
}
term_update(term);
}
@@
-1619,10
+1619,14
@@
void term_free(Terminal *term)
for (i = 0; i < term->bidi_cache_size; i++) {
sfree(term->pre_bidi_cache[i].chars);
sfree(term->post_bidi_cache[i].chars);
for (i = 0; i < term->bidi_cache_size; i++) {
sfree(term->pre_bidi_cache[i].chars);
sfree(term->post_bidi_cache[i].chars);
+ sfree(term->post_bidi_cache[i].forward);
+ sfree(term->post_bidi_cache[i].backward);
}
sfree(term->pre_bidi_cache);
sfree(term->post_bidi_cache);
}
sfree(term->pre_bidi_cache);
sfree(term->post_bidi_cache);
+ sfree(term->tabs);
+
expire_timer_context(term);
conf_free(term->conf);
expire_timer_context(term);
conf_free(term->conf);
@@
-1711,7
+1715,8
@@
void term_size(Terminal *term, int newrows, int newcols, int newsavelines)
while (term->rows > newrows) {
if (term->curs.y < term->rows - 1) {
/* delete bottom row, unless it contains the cursor */
while (term->rows > newrows) {
if (term->curs.y < term->rows - 1) {
/* delete bottom row, unless it contains the cursor */
- sfree(delpos234(term->screen, term->rows - 1));
+ line = delpos234(term->screen, term->rows - 1);
+ freeline(line);
} else {
/* push top row to scrollback */
line = delpos234(term->screen, 0);
} else {
/* push top row to scrollback */
line = delpos234(term->screen, 0);
@@
-1973,7
+1978,7
@@
static void check_selection(Terminal *term, pos from, pos to)
static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
{
termline *line;
static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
{
termline *line;
- int i, seltop;
+ int i, seltop
, scrollwinsize
;
#ifdef OPTIMISE_SCROLL
int olddisptop, shift;
#endif /* OPTIMISE_SCROLL */
#ifdef OPTIMISE_SCROLL
int olddisptop, shift;
#endif /* OPTIMISE_SCROLL */
@@
-1985,8
+1990,14
@@
static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
olddisptop = term->disptop;
shift = lines;
#endif /* OPTIMISE_SCROLL */
olddisptop = term->disptop;
shift = lines;
#endif /* OPTIMISE_SCROLL */
+
+ scrollwinsize = botline - topline + 1;
+
if (lines < 0) {
if (lines < 0) {
- while (lines < 0) {
+ lines = -lines;
+ if (lines > scrollwinsize)
+ lines = scrollwinsize;
+ while (lines-- > 0) {
line = delpos234(term->screen, botline);
resizeline(term, line, term->cols);
for (i = 0; i < term->cols; i++)
line = delpos234(term->screen, botline);
resizeline(term, line, term->cols);
for (i = 0; i < term->cols; i++)
@@
-2008,11
+2019,11
@@
static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
term->selend.x = 0;
}
}
term->selend.x = 0;
}
}
-
- lines++;
}
} else {
}
} else {
- while (lines > 0) {
+ if (lines > scrollwinsize)
+ lines = scrollwinsize;
+ while (lines-- > 0) {
line = delpos234(term->screen, topline);
#ifdef TERM_CC_DIAGS
cc_check(line);
line = delpos234(term->screen, topline);
#ifdef TERM_CC_DIAGS
cc_check(line);
@@
-2098,8
+2109,6
@@
static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
}
}
}
}
}
}
-
- lines--;
}
}
#ifdef OPTIMISE_SCROLL
}
}
#ifdef OPTIMISE_SCROLL