From 7f2c78bc7becb19fb0e13eba279a65a647683089 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 23 Sep 2022 21:03:36 +0200 Subject: Fix centering with ANSI escapes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was broken with the logic change in #68f7fb9 I think. At the very least it’s that commit after which I noticed this bug. Doesn’t matter though, it’s fixed now. --- center.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/center.c b/center.c index be6d9ee..10e8130 100644 --- a/center.c +++ b/center.c @@ -165,7 +165,7 @@ noesclen(const char *s) while ((d = strchr(d, ESC)) != NULL) off += matchesc(++d); - return utf8len(s) + off; + return utf8len(s) - off; } /* Return the length of the ANSI color escape sequence at the beginning of the string `s'. If no -- cgit v1.2.3