X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=terminal.h;h=c3ee216f5c8d29c5210455a889ef26a04dfde673;hb=dbe68abfff519b485d535df46c833f56758c07e3;hp=fe8263c868471e9c871b64f6ad9c9e80ad08ee49;hpb=e9cc32850132b0ed4bc1279200ef9a432dc8d0f5;p=PuTTY.git 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)