From 42d4a6be70909ff05ee55a1487a017b373b856d3 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Tue, 5 May 2015 19:34:12 +0800 Subject: [PATCH] sizes reported by list-buffers are aligned with size reported by buffer-position. --- buffer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/buffer.c b/buffer.c index a9e0ce4..c1d3829 100644 --- a/buffer.c +++ b/buffer.c @@ -310,6 +310,7 @@ static int makelist( int iflag) int s; int i; long nbytes; /* # of bytes in current buffer */ + long nlines ; /* # of lines in current buffer */ char b[ 8 + 1] ; char line[MAXLINE]; @@ -318,7 +319,7 @@ static int makelist( int iflag) return s; strcpy(blistp->b_fname, ""); if( addline("ACT MODES Size Buffer File") == FALSE - || addline("--- ----- ---- ------ ----") == FALSE) + || addline("‾‾‾ ‾‾‾‾‾ ‾‾‾‾ ‾‾‾‾‾‾ ‾‾‾‾") == FALSE) return FALSE; bp = bheadp; /* For all buffers */ @@ -380,11 +381,17 @@ static int makelist( int iflag) /* Buffer size */ nbytes = 0L; /* Count bytes in buf. */ + nlines = 0 ; lp = lforw(bp->b_linep); while (lp != bp->b_linep) { nbytes += (long) llength(lp) + 1L; + nlines += 1 ; lp = lforw(lp); } + + if( curbp->b_mode & MDDOS) + nbytes += nlines ; + l_to_a( b, sizeof b, nbytes) ; /* 8 digits string buffer size. */ cp2 = &b[0]; while ((c = *cp2++) != 0)