column counter (cnt) not reset to 0 on display of '\r' which could cause
unnecessary forced linewraps on some terminals. Submitted by: David McNett <nugget@slacker.com>
This commit is contained in:
parent
f72286af57
commit
c87eca8b08
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50776
@ -182,7 +182,9 @@ makemsg(fname)
|
||||
errx(1, "can't read %s", fname);
|
||||
while (fgets(lbuf, sizeof(lbuf), stdin))
|
||||
for (cnt = 0, p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) {
|
||||
if (cnt == 79 || ch == '\n') {
|
||||
if (ch == '\r') {
|
||||
cnt = 0;
|
||||
} else if (cnt == 79 || ch == '\n') {
|
||||
for (; cnt < 79; ++cnt)
|
||||
putc(' ', fp);
|
||||
putc('\r', fp);
|
||||
@ -217,6 +219,7 @@ makemsg(fname)
|
||||
cnt = 0;
|
||||
}
|
||||
}
|
||||
putc(ch, fp);
|
||||
} else {
|
||||
putc(ch, fp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user