aboutsummaryrefslogtreecommitdiff
path: root/ncurses/tinfo/trim_sgr0.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/tinfo/trim_sgr0.c')
-rw-r--r--ncurses/tinfo/trim_sgr0.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c
index 30c8f75c1e8a..177dcd87225e 100644
--- a/ncurses/tinfo/trim_sgr0.c
+++ b/ncurses/tinfo/trim_sgr0.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 2005-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -37,15 +37,11 @@
#include <tic.h>
-MODULE_ID("$Id: trim_sgr0.c,v 1.20 2020/05/27 23:54:31 tom Exp $")
+MODULE_ID("$Id: trim_sgr0.c,v 1.22 2023/09/23 18:47:56 tom Exp $")
#undef CUR
#define CUR tp->
-#define CSI 233
-#define ESC 033 /* ^[ */
-#define L_BRACK '['
-
static char *
set_attribute_9(TERMTYPE2 *tp, int flag)
{
@@ -65,9 +61,9 @@ is_csi(const char *s)
{
int result = 0;
if (s != 0) {
- if (UChar(s[0]) == CSI)
+ if (UChar(s[0]) == CSI_CHR)
result = 1;
- else if (s[0] == ESC && s[1] == L_BRACK)
+ else if (s[0] == ESC_CHR && s[1] == L_BLOCK)
result = 2;
}
return result;
@@ -222,7 +218,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