In immediate mode, print with the current width.

(cherry picked from commit 7d489233e5f27decdbcfb0e8ecba0b0b5fdc6066)
This commit is contained in:
Christos Zoulas 2022-10-24 20:21:54 +00:00 committed by Xin LI
parent ac428f59cd
commit d5e82a1bb0

View file

@ -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 **,