]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/trim_sgr0.c
ncurses 6.2 - patch 20210821
[ncurses.git] / ncurses / tinfo / trim_sgr0.c
index 4cbcb6506772c21a9fdd67398b952422be7b19a0..22bc82ff37173d2b35fb7d1d7722dc5b9e72c0cf 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 2005-2012,2017 Free Software Foundation, Inc.              *
+ * Copyright 2020,2021 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 <tic.h>
 
-MODULE_ID("$Id: trim_sgr0.c,v 1.16 2017/04/05 22:33:07 tom Exp $")
+MODULE_ID("$Id: trim_sgr0.c,v 1.21 2021/06/17 21:20:30 tom Exp $")
 
 #undef CUR
 #define CUR tp->
@@ -51,7 +52,7 @@ 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
@@ -221,7 +222,7 @@ compare_part(const char *part, const char *full)
 }
 
 /*
- * While 'sgr0' is the "same" as termcap 'me', there is a compatibility issue. 
+ * While 'sgr0' is the "same" as termcap 'me', there is a compatibility issue.
  * The sgr/sgr0 capabilities include setting/clearing alternate character set
  * mode.  A termcap application cannot use sgr, so sgr0 strings that reset
  * alternate character set mode will be misinterpreted.  Here, we remove those
@@ -263,7 +264,7 @@ _nc_trim_sgr0(TERMTYPE2 *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);