https://gitlab.synchro.net/main/sbbs/-/commit/8765b836bff9379cf8d8705f
Modified Files:
src/sbbs3/str_util.c
Log Message:
fmt_col_widths: measure strings holding Ctrl-A codes
The early-out skipped any argument str_is_ascii() accepted, on the
grounds that a byte is then a column. A Ctrl-A code is ASCII but prints nothing, so a field carrying one measured two bytes short per code and
came up that many columns narrow -- the very miscount the function
exists to correct.
Skip only a string that is both ASCII and free of Ctrl-A. Terminal::
bstrlen(), which does the measuring, already gave the codes their real
display semantics; it was simply never reached for these strings.
Message header fields carry no Ctrl-A codes today, so no caller is
affected yet. This matters for fmt_col_widths() as an exported utility
in str_util.h: a future caller formatting text that does carry codes
would otherwise inherit an unstated assumption and get silently short
fields.
Other control characters are left as they were. bstrlen() treats \r and
\n as ending the measurement, so widening the test to every control
would truncate a field at the first newline and drop the remainder --
a behavior change, not a fix. Ctrl-A never terminates measurement and
carries no such risk.
Follow-up to d91e670aae (lift-11-dash, 2026-07-28), issue #1204
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net