X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftic.c;h=9b02a23216fa843faca37c29f76738dbd64d36d5;hp=c98cda606ff8c6b6dc18b99d1efd520e570f1063;hb=9a9dd79463eba7af0b06b6a1f7e580b632ec1be1;hpb=fae162795e065e5901068152e91f2962b6b247f3 diff --git a/progs/tic.c b/progs/tic.c index c98cda60..9b02a232 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -49,7 +49,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.290 2020/11/14 18:16:33 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.291 2021/02/20 23:57:24 tom Exp $") #define STDIN_NAME "" @@ -1711,6 +1711,7 @@ check_screen(TERMTYPE2 *tp) int have_bce = back_color_erase; bool have_kmouse = FALSE; bool use_sgr_39_49 = FALSE; + const char *name_39_49 = "orig_pair or orig_colors"; char *name = _nc_first_name(tp->term_names); bool is_screen = !strncmp(name, "screen", 6); bool screen_base = (is_screen @@ -1728,10 +1729,15 @@ check_screen(TERMTYPE2 *tp) if (VALID_STRING(key_mouse)) { have_kmouse = !strcmp("\033[M", key_mouse); } - if (VALID_STRING(orig_colors)) { - use_sgr_39_49 = uses_SGR_39_49(orig_colors); - } else if (VALID_STRING(orig_pair)) { - use_sgr_39_49 = uses_SGR_39_49(orig_pair); + if (have_bce) { + if (VALID_STRING(orig_pair)) { + name_39_49 = "orig_pair"; + use_sgr_39_49 = uses_SGR_39_49(orig_pair); + } + if (!use_sgr_39_49 && VALID_STRING(orig_colors)) { + name_39_49 = "orig_colors"; + use_sgr_39_49 = uses_SGR_39_49(orig_colors); + } } if (have_XM && have_XT) { @@ -1746,10 +1752,14 @@ check_screen(TERMTYPE2 *tp) _nc_warning("expected kmous capability with XT"); } } - if (!have_bce && max_colors > 0) - _nc_warning("expected bce capability with XT"); - if (!use_sgr_39_49 && have_bce && max_colors > 0) - _nc_warning("expected orig_colors capability with XT to have 39/49 parameters"); + if (max_colors > 0) { + if (!have_bce) { + _nc_warning("expected bce capability with XT"); + } else if (!use_sgr_39_49) { + _nc_warning("expected %s capability with XT " + "to have 39/49 parameters", name_39_49); + } + } if (VALID_STRING(to_status_line)) _nc_warning("\"tsl\" capability is redundant, given XT"); } else {