summaryrefslogtreecommitdiff
path: root/zwgc/tty_filter.c
diff options
context:
space:
mode:
authorGravatar John F. Carr <jfc@mit.edu>1991-12-30 14:01:54 +0000
committerGravatar John F. Carr <jfc@mit.edu>1991-12-30 14:01:54 +0000
commitbd7b994215ac80c4bcbd6f91261c01d6e6c4369b (patch)
tree85717e89d55496cfc78299745de42f0ebf0255f7 /zwgc/tty_filter.c
parenta0ecf3addbe127c4ec7e4c00def38ac6b4a32fdc (diff)
Ignore "@color" and "@font".
Diffstat (limited to 'zwgc/tty_filter.c')
-rw-r--r--zwgc/tty_filter.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/zwgc/tty_filter.c b/zwgc/tty_filter.c
index 3a2a675..1dffb70 100644
--- a/zwgc/tty_filter.c
+++ b/zwgc/tty_filter.c
@@ -195,6 +195,7 @@ typedef struct _tty_str_info {
int bold_p : 1;
int italic_p : 1;
int bell_p : 1;
+ int ignore: 1;
} tty_str_info;
static void free_info(info)
@@ -239,6 +240,12 @@ static int do_mode_change(current_mode_p, text, text_length)
current_mode_p->bell_p = 1;
return 1;
}
+
+ /* commands ignored in tty mode: */
+ else if (fixed_string_eq("color", text, text_length) ||
+ fixed_string_eq("font", text, text_length)) {
+ current_mode_p->ignore = 1;
+ }
return 0;
}
@@ -251,7 +258,7 @@ static tty_str_info *convert_desc_to_tty_str_info(desc)
int isbeep, did_beep = 0;
#if !defined(SABER) && defined(__STDC__)
- tty_str_info current_mode = { NULL, "", 0, 'l', 0 , 0, 0};
+ tty_str_info current_mode = { NULL, "", 0, 'l', 0 , 0, 0, 0};
#else
/* This is needed due to a bug in saber, and lack of pre-ANSI support. */
tty_str_info current_mode;
@@ -263,6 +270,7 @@ static tty_str_info *convert_desc_to_tty_str_info(desc)
current_mode.bold_p = 0;
current_mode.italic_p = 0;
current_mode.bell_p = 0;
+ current_mode.ignore = 0;
#endif
for (; desc->code!=DT_EOF; desc=desc->next) {
@@ -434,7 +442,12 @@ string tty_filter(text, use_fonts)
right = string_Copy("");
for (; info && info->alignment!=' '; info=info->next) {
- string item = string_Copy("");
+ string item;
+
+ if (info->ignore)
+ continue;
+
+ item = string_Copy("");
if (info->bold_p && use_fonts) {
if (temp = string_dictionary_Fetch(termcap_dict, "B.bold"))