X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Ftrim_sgr0.c;h=30c8f75c1e8a718cce978b723a557fe9af517de1;hp=ec5e2b78dbf0344ebaf7530001fa649f6a4d6eac;hb=312665d3aaaf5d8e3ba34d80fdd650abf758272a;hpb=1c551ea75ea57f9186fbe8d79674ac85baa4d358 diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index ec5e2b78..30c8f75c 100644 --- a/ncurses/tinfo/trim_sgr0.c +++ b/ncurses/tinfo/trim_sgr0.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 2005-2010,2012 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 2005-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,7 +37,7 @@ #include -MODULE_ID("$Id: trim_sgr0.c,v 1.15 2012/12/15 20:57:17 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.20 2020/05/27 23:54:31 tom Exp $") #undef CUR #define CUR tp-> @@ -46,12 +47,12 @@ MODULE_ID("$Id: trim_sgr0.c,v 1.15 2012/12/15 20:57:17 tom Exp $") #define L_BRACK '[' static char * -set_attribute_9(TERMTYPE *tp, int flag) +set_attribute_9(TERMTYPE2 *tp, int flag) { const char *value; char *result; - value = tparm(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, flag); + value = TIPARM_9(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, flag); if (PRESENT(value)) result = strdup(value); else @@ -232,7 +233,7 @@ compare_part(const char *part, const char *full) * an error occurs, or the original sgr0 if no change is needed. */ NCURSES_EXPORT(char *) -_nc_trim_sgr0(TERMTYPE *tp) +_nc_trim_sgr0(TERMTYPE2 *tp) { char *result = exit_attribute_mode; @@ -263,7 +264,7 @@ _nc_trim_sgr0(TERMTYPE *tp) /* * If rmacs is a substring of sgr(0), remove that chunk. */ - if (exit_alt_charset_mode != 0) { + if (PRESENT(exit_alt_charset_mode)) { TR(TRACE_DATABASE, ("scan for rmacs %s", _nc_visbuf(exit_alt_charset_mode))); j = strlen(off); k = strlen(exit_alt_charset_mode);