1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-21 00:26:27 -05:00

sizes reported by list-buffers are aligned with size reported by buffer-position.

This commit is contained in:
Renaud 2015-05-05 19:34:12 +08:00
parent 0dc28967b5
commit 42d4a6be70

View File

@ -310,6 +310,7 @@ static int makelist( int iflag)
int s; int s;
int i; int i;
long nbytes; /* # of bytes in current buffer */ long nbytes; /* # of bytes in current buffer */
long nlines ; /* # of lines in current buffer */
char b[ 8 + 1] ; char b[ 8 + 1] ;
char line[MAXLINE]; char line[MAXLINE];
@ -318,7 +319,7 @@ static int makelist( int iflag)
return s; return s;
strcpy(blistp->b_fname, ""); strcpy(blistp->b_fname, "");
if( addline("ACT MODES Size Buffer File") == FALSE if( addline("ACT MODES Size Buffer File") == FALSE
|| addline("--- ----- ---- ------ ----") == FALSE) || addline("‾‾‾ ‾‾‾‾‾ ‾‾‾‾ ‾‾‾‾‾‾ ‾‾‾‾") == FALSE)
return FALSE; return FALSE;
bp = bheadp; /* For all buffers */ bp = bheadp; /* For all buffers */
@ -380,11 +381,17 @@ static int makelist( int iflag)
/* Buffer size */ /* Buffer size */
nbytes = 0L; /* Count bytes in buf. */ nbytes = 0L; /* Count bytes in buf. */
nlines = 0 ;
lp = lforw(bp->b_linep); lp = lforw(bp->b_linep);
while (lp != bp->b_linep) { while (lp != bp->b_linep) {
nbytes += (long) llength(lp) + 1L; nbytes += (long) llength(lp) + 1L;
nlines += 1 ;
lp = lforw(lp); lp = lforw(lp);
} }
if( curbp->b_mode & MDDOS)
nbytes += nlines ;
l_to_a( b, sizeof b, nbytes) ; /* 8 digits string buffer size. */ l_to_a( b, sizeof b, nbytes) ; /* 8 digits string buffer size. */
cp2 = &b[0]; cp2 = &b[0];
while ((c = *cp2++) != 0) while ((c = *cp2++) != 0)