sed: MB_LEN_MAX→MCEL_CUR_MAX

* sed/debug.c (debug_print_mb):
* sed/execute.c (str_append_modified, do_list, translate_mb):
Prefer MCEL_LEN_MAX to MB_LEN_MAX where either will do.
This commit is contained in:
Paul Eggert committed 2026-08-17 01:17:23 -07:00
1 parent c39cfe4fa3
commit e236a2345e
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -235,7 +235,7 @@ debug_print_mb (int ch)
fputc (-ch, stdout);
else
{
char buf[MB_LEN_MAX];
char buf[MCEL_LEN_MAX];
fwrite (buf, 1, c32rtomb1 (buf, ch), stdout);
}
}
+3 -3
View File
@@ -169,7 +169,7 @@ str_append_modified (struct line *to, const char *string, idx_t length,
}
idx_t worst_case_growth;
if (ckd_mul (&worst_case_growth, length, MB_LEN_MAX))
if (ckd_mul (&worst_case_growth, length, MCEL_LEN_MAX))
xalloc_die ();
if (to->alloc - to->length < worst_case_growth)
resize_line (to, worst_case_growth);
@@ -841,7 +841,7 @@ do_list (intmax_t line_len)
for (char *p = line.active; p < plim; p += g.len)
{
g = mcel_scan (p, plim);
char obuf[(sizeof "\\377" - 1) * MB_LEN_MAX];
char obuf[(sizeof "\\377" - 1) * MCEL_LEN_MAX];
char *o = obuf;
*o = '\\';
if (c32isprint (g.ch))
@@ -1117,7 +1117,7 @@ translate_mb (idx_t npairs, int *pair)
{
bool move_remain_buffer = false;
int tr = pair[2 * i + 1];
char mbuf[MB_LEN_MAX];
char mbuf[MCEL_LEN_MAX];
idx_t trans_len;
if (tr < 0)
{