=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/match.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- src/usr.bin/mg/match.c 2023/04/17 15:18:25 1.24 +++ src/usr.bin/mg/match.c 2023/04/21 13:39:37 1.25 @@ -1,4 +1,4 @@ -/* $OpenBSD: match.c,v 1.24 2023/04/17 15:18:25 op Exp $ */ +/* $OpenBSD: match.c,v 1.25 2023/04/21 13:39:37 op Exp $ */ /* This file is in the public domain. */ @@ -136,6 +136,7 @@ int cp; int bufo; int c; + int col; int inwindow; char buf[NLINE]; @@ -181,9 +182,9 @@ } else buf[bufo++] = c; } else { - do { + col = ntabstop(bufo, curbp->b_tabw); + while (bufo < col && bufo < sizeof(buf) - 1) buf[bufo++] = ' '; - } while ((bufo & 7) && bufo < sizeof(buf) - 1); } } buf[bufo++] = '\0';