From d5e82a1bb004a69121b68544fac83c788f62544b Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 24 Oct 2022 20:21:54 +0000 Subject: [PATCH] In immediate mode, print with the current width. (cherry picked from commit 7d489233e5f27decdbcfb0e8ecba0b0b5fdc6066) --- src/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/file.c b/src/file.c index c3b15cab9da..2cf7bca68ee 100644 --- a/src/file.c +++ b/src/file.c @@ -531,15 +531,15 @@ unwrap(struct magic_set *ms, const char *fn, int immed) if (line[len - 1] == '\n') line[len - 1] = '\0'; cwid = file_mbswidth(ms, line); - if (cwid > wid) - wid = cwid; if (immed) { - e |= process(ms, line, wid); + e |= process(ms, line, cwid); free(line); line = NULL; llen = 0; continue; } + if (cwid > wid) + wid = cwid; if (fi >= fimax) { fimax += 100; char **nf = CAST(char **,