sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-11-11 01:29:48 +00:00
parent 5903cbe575
commit 62d64fa864
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
841 changed files with 83929 additions and 40755 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: screen-write.c,v 1.222 2023/09/15 15:49:05 nicm Exp $ */
/* $OpenBSD: screen-write.c,v 1.224 2023/10/30 16:05:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -2013,7 +2013,7 @@ screen_write_combine(struct screen_write_ctx *ctx, const struct grid_cell *gc)
/*
* Check if we need to combine characters. This could be zero width
* (zet above), a modifier character (with an existing Unicode
* (set above), a modifier character (with an existing Unicode
* character) or a previous ZWJ.
*/
if (!zero_width) {
@ -2025,6 +2025,10 @@ screen_write_combine(struct screen_write_ctx *ctx, const struct grid_cell *gc)
return (0);
}
/* Check if this combined character would be too long. */
if (last.data.size + ud->size > sizeof last.data.data)
return (0);
/* Combining; flush any pending output. */
screen_write_collect_flush(ctx, 0, __func__);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tty-term.c,v 1.100 2023/09/02 09:17:23 nicm Exp $ */
/* $OpenBSD: tty-term.c,v 1.101 2023/10/17 09:55:32 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -761,7 +761,7 @@ tty_term_string_i(struct tty_term *term, enum tty_code_code code, int a)
{
const char *x = tty_term_string(term, code), *s;
s = tparm((char *)x, a);
s = tiparm_s(1, 0, x, a);
if (s == NULL) {
log_debug("could not expand %s", tty_term_codes[code].name);
return ("");
@ -774,7 +774,7 @@ 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;
s = tparm((char *)x, a, b);
s = tiparm_s(2, 0, x, a, b);
if (s == NULL) {
log_debug("could not expand %s", tty_term_codes[code].name);
return ("");
@ -788,7 +788,7 @@ tty_term_string_iii(struct tty_term *term, enum tty_code_code code, int a,
{
const char *x = tty_term_string(term, code), *s;
s = tparm((char *)x, a, b, c);
s = tiparm_s(3, 0, x, a, b, c);
if (s == NULL) {
log_debug("could not expand %s", tty_term_codes[code].name);
return ("");
@ -801,7 +801,7 @@ 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;
s = tparm((char *)x, (long)a);
s = tiparm_s(1, 1, x, a);
if (s == NULL) {
log_debug("could not expand %s", tty_term_codes[code].name);
return ("");
@ -815,7 +815,7 @@ tty_term_string_ss(struct tty_term *term, enum tty_code_code code,
{
const char *x = tty_term_string(term, code), *s;
s = tparm((char *)x, (long)a, (long)b);
s = tiparm_s(2, 3, x, a, b);
if (s == NULL) {
log_debug("could not expand %s", tty_term_codes[code].name);
return ("");

View file

@ -1,4 +1,4 @@
/* $OpenBSD: window-copy.c,v 1.344 2023/09/04 08:01:43 nicm Exp $ */
/* $OpenBSD: window-copy.c,v 1.345 2023/11/02 10:38:14 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -2719,7 +2719,7 @@ static const struct {
},
{ .command = "next-prompt",
.minargs = 0,
.maxargs = 0,
.maxargs = 1,
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
.f = window_copy_cmd_next_prompt
},

View file

@ -1,4 +1,4 @@
/* $OpenBSD: window.c,v 1.286 2023/07/10 09:24:53 nicm Exp $ */
/* $OpenBSD: window.c,v 1.287 2023/10/23 08:12:00 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -340,6 +340,7 @@ window_destroy(struct window *w)
{
log_debug("window @%u destroyed (%d references)", w->id, w->references);
window_unzoom(w);
RB_REMOVE(windows, &windows, w);
if (w->layout_root != NULL)