X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/4683b9b61410e3cb14e944f68e238b147c67f907..9bb8630af3373e7bbf594bfeda731585684e1b69:/terminal.h diff --git a/terminal.h b/terminal.h index fe8263c8..c3ee216f 100644 --- a/terminal.h +++ b/terminal.h @@ -53,7 +53,8 @@ struct terminal_tag { int beep_overloaded; long lastbeep; -#define TSIZE (sizeof(unsigned long)) +#define TTYPE unsigned long +#define TSIZE (sizeof(TTYPE)) #define fix_cpos do { \ term->cpos = lineptr(term->curs.y) + term->curs.x; \ } while(0) @@ -62,7 +63,7 @@ struct terminal_tag { struct scrollregion *scrollhead, *scrolltail; #endif /* OPTIMISE_SCROLL */ - unsigned long curr_attr, save_attr; + unsigned long default_attr, curr_attr, save_attr; unsigned long erase_char; bufchain inbuf; /* terminal input buffer */ @@ -197,6 +198,16 @@ struct terminal_tag { * than only the default. */ Config cfg; + + /* + * from_backend calls term_out, but it can also be called from + * the ldisc if the ldisc is called _within_ term_out. So we + * have to guard against re-entrancy - if from_backend is + * called recursively like this, it will simply add data to the + * end of the buffer term_out is in the process of working + * through. + */ + int in_term_out; }; #define in_utf(term) ((term)->utf || (term)->ucsdata->line_codepage==CP_UTF8)