mirror of
https://github.com/tmux/tmux.git
synced 2025-01-10 01:58:51 +00:00
Use ncurses' new tparm_s function (added in 6.4-20230424) instead of tparm so
it does not object to string arguments in capabilities it doesn't already know.
This commit is contained in:
parent
9d8131c190
commit
39d41d0810
@ -350,6 +350,10 @@ else
|
|||||||
AC_MSG_ERROR("curses not found")
|
AC_MSG_ERROR("curses not found")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
AC_CHECK_FUNCS([ \
|
||||||
|
tiparm \
|
||||||
|
tiparm_s \
|
||||||
|
])
|
||||||
|
|
||||||
# Look for utempter.
|
# Look for utempter.
|
||||||
AC_ARG_ENABLE(
|
AC_ARG_ENABLE(
|
||||||
|
48
tty-term.c
48
tty-term.c
@ -770,7 +770,13 @@ tty_term_string_i(struct tty_term *term, enum tty_code_code code, int a)
|
|||||||
{
|
{
|
||||||
const char *x = tty_term_string(term, code), *s;
|
const char *x = tty_term_string(term, code), *s;
|
||||||
|
|
||||||
s = tparm((char *)x, a);
|
#if defined(HAVE_TIPARM_S)
|
||||||
|
s = tiparm_s(1, 0, x, a);
|
||||||
|
#elif defined(HAVE_TIPARM)
|
||||||
|
s = tiparm(x, a);
|
||||||
|
#else
|
||||||
|
s = tparm((char *)x, a, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||||
|
#endif
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
fatalx("could not expand %s", tty_term_codes[code].name);
|
fatalx("could not expand %s", tty_term_codes[code].name);
|
||||||
return (s);
|
return (s);
|
||||||
@ -781,19 +787,31 @@ tty_term_string_ii(struct tty_term *term, enum tty_code_code code, int a, int b)
|
|||||||
{
|
{
|
||||||
const char *x = tty_term_string(term, code), *s;
|
const char *x = tty_term_string(term, code), *s;
|
||||||
|
|
||||||
s = tparm((char *)x, a, b);
|
#if defined(HAVE_TIPARM_S)
|
||||||
|
s = tiparm_s(2, 0, x, a, b);
|
||||||
|
#elif defined(HAVE_TIPARM)
|
||||||
|
s = tiparm(x, a, b);
|
||||||
|
#else
|
||||||
|
s = tparm((char *)x, a, b, 0, 0, 0, 0, 0, 0, 0);
|
||||||
|
#endif
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
fatalx("could not expand %s", tty_term_codes[code].name);
|
fatalx("could not expand %s", tty_term_codes[code].name);
|
||||||
return (s);
|
return (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
tty_term_string_iii(struct tty_term *term, enum tty_code_code code, int a, int b,
|
tty_term_string_iii(struct tty_term *term, enum tty_code_code code, int a,
|
||||||
int c)
|
int b, int c)
|
||||||
{
|
{
|
||||||
const char *x = tty_term_string(term, code), *s;
|
const char *x = tty_term_string(term, code), *s;
|
||||||
|
|
||||||
s = tparm((char *)x, a, b, c);
|
#if defined(HAVE_TIPARM_S)
|
||||||
|
s = tiparm_s(3, 0, x, a, b, c);
|
||||||
|
#elif defined(HAVE_TIPARM)
|
||||||
|
s = tiparm(x, a, b, c);
|
||||||
|
#else
|
||||||
|
s = tparm((char *)x, a, b, c, 0, 0, 0, 0, 0, 0);
|
||||||
|
#endif
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
fatalx("could not expand %s", tty_term_codes[code].name);
|
fatalx("could not expand %s", tty_term_codes[code].name);
|
||||||
return (s);
|
return (s);
|
||||||
@ -804,19 +822,31 @@ tty_term_string_s(struct tty_term *term, enum tty_code_code code, const char *a)
|
|||||||
{
|
{
|
||||||
const char *x = tty_term_string(term, code), *s;
|
const char *x = tty_term_string(term, code), *s;
|
||||||
|
|
||||||
s = tparm((char *)x, (long)a);
|
#if defined(HAVE_TIPARM_S)
|
||||||
|
s = tiparm_s(1, 1, x, a);
|
||||||
|
#elif defined(HAVE_TIPARM)
|
||||||
|
s = tiparm(x, a);
|
||||||
|
#else
|
||||||
|
s = tparm((char *)x, (long)a, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||||
|
#endif
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
fatalx("could not expand %s", tty_term_codes[code].name);
|
fatalx("could not expand %s", tty_term_codes[code].name);
|
||||||
return (s);
|
return (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
tty_term_string_ss(struct tty_term *term, enum tty_code_code code, const char *a,
|
tty_term_string_ss(struct tty_term *term, enum tty_code_code code,
|
||||||
const char *b)
|
const char *a, const char *b)
|
||||||
{
|
{
|
||||||
const char *x = tty_term_string(term, code), *s;
|
const char *x = tty_term_string(term, code), *s;
|
||||||
|
|
||||||
s = tparm((char *)x, (long)a, (long)b);
|
#if defined(HAVE_TIPARM_S)
|
||||||
|
s = tiparm_s(2, 3, x, a, b);
|
||||||
|
#elif defined(HAVE_TIPARM)
|
||||||
|
s = tiparm(x, a, b);
|
||||||
|
#else
|
||||||
|
s = tparm((char *)x, (long)a, b, 0, 0, 0, 0, 0, 0, 0);
|
||||||
|
#endif
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
fatalx("could not expand %s", tty_term_codes[code].name);
|
fatalx("could not expand %s", tty_term_codes[code].name);
|
||||||
return (s);
|
return (s);
|
||||||
|
Loading…
Reference in New Issue
Block a user